]> granicus.if.org Git - llvm/commit
[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)
commit6ddf645b77a0ebb064e7138d367bc02c007a0de6
treec9f1b071818c3eb1a4208251438bddf5beedb2b8
parent02ee50371950de6974303b134081e1bb48667aad
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316331 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/avx-vbroadcast.ll