[DAGCombine] Permit combining of shuffles of equivalent splat BUILD_VECTORs
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 23 Oct 2017 15:48:08 +0000 (15:48 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 23 Oct 2017 15:48:08 +0000 (15:48 +0000)
commit32da2f9245f259fc437129ec9894e664b64ad0d4
tree6c5c61a606556bf63be0159baeb91962eb79688c
parentf9cb007355de70b6e8204156fdcfaf886dbed316
[DAGCombine] Permit combining of shuffles of equivalent splat BUILD_VECTORs

combineShuffleOfScalars is very conservative about shuffled BUILD_VECTORs that can be combined together.

This patch adds one additional case - if both BUILD_VECTORs represent splats of the same scalar value but with different UNDEF elements, then we should create a single splat BUILD_VECTOR, sharing only the UNDEF elements defined by the shuffle mask.

Differential Revision: https://reviews.llvm.org/D38696

llvm-svn: 316331
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/avx-vbroadcast.ll