[x86] Teach the new vector shuffle lowering code to handle what is
authorChandler Carruth <chandlerc@gmail.com>
Mon, 7 Jul 2014 09:06:58 +0000 (09:06 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 7 Jul 2014 09:06:58 +0000 (09:06 +0000)
commit36ad61f4eac4e3c22789e1cef4e6aa50b054052f
tree51a5a6cc82ad0db321af3a3f47f5bbaebeb28118
parent3e16b022be11d0ab22a726ab8e97cda083b32cd7
[x86] Teach the new vector shuffle lowering code to handle what is
essentially a DAG combine that never gets a chance to run.

We might typically expect DAG combining to remove shuffles-of-splats and
other similar patterns, but we don't get a chance to run the DAG
combiner when we recursively form sub-shuffles during the lowering of
a shuffle. So instead hand-roll a really important combine directly into
the lowering code to detect shuffles-of-splats, especially shuffles of
an all-zero splat which needn't even have the same element width, etc.

This lets the new vector shuffle lowering handle shuffles which
implement things like zero-extension really nicely. This will become
even more important when I wire the legalization of zero-extension to
vector shuffles with the new widening legalization strategy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212444 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/vector-shuffle-128-v16.ll