[SDAG] Teach the SelectionDAG to canonicalize vector shuffles of splats
authorChandler Carruth <chandlerc@gmail.com>
Sun, 15 Feb 2015 12:18:12 +0000 (12:18 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 15 Feb 2015 12:18:12 +0000 (12:18 +0000)
commit72753f87f2b80d66cfd7ca7c7b6c0db6737d4b24
treec42e2f19b17862dcf6b7da86dfef8d323a4ac13b
parent3d39845812f510eef949fc318b3b437fbd334cc7
[SDAG] Teach the SelectionDAG to canonicalize vector shuffles of splats
directly into blends of the splats.

These patterns show up even very late in the vector shuffle lowering
where we don't have any chance for DAG combining to kick in, and
blending is a tremendously simpler operation to model. By coercing the
shuffle into a blend we can much more easily match and lower shuffles of
splats.

Immediately with this change there are significantly more blends being
matched in the x86 vector shuffle lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229308 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/AArch64/arm64-vshuffle.ll
test/CodeGen/X86/combine-or.ll
test/CodeGen/X86/sse41.ll
test/CodeGen/X86/vec_insert-5.ll
test/CodeGen/X86/vector-shuffle-128-v4.ll
test/CodeGen/X86/vector-shuffle-128-v8.ll
test/CodeGen/X86/vector-shuffle-256-v16.ll
test/CodeGen/X86/vector-shuffle-256-v32.ll
test/CodeGen/X86/vector-shuffle-256-v8.ll
test/CodeGen/X86/vector-shuffle-combining.ll
test/CodeGen/X86/vector-shuffle-sse1.ll