[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)
commit0dcb366268eebecaad88dcc6ae8166b0f61e9b7f
treed4cb45aabcda4668febc8687e39613ca414f5bda
parent55beb64bd063196acda5dd51e7e63f2ceae48ee7
[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.

llvm-svn: 212444
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-shuffle-128-v16.ll