[x86] Add a dedicated lowering path for zext-compatible vector shuffles
authorChandler Carruth <chandlerc@gmail.com>
Fri, 19 Sep 2014 06:07:49 +0000 (06:07 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 19 Sep 2014 06:07:49 +0000 (06:07 +0000)
commit330aa6fd6b5f2468e9eafca0586fd8ca4dc555eb
tree6ebbe889b3f8e773e91e16b18391d4078e12aa3c
parent61519cd69995d24d592468dc628470d1ba3cfa72
[x86] Add a dedicated lowering path for zext-compatible vector shuffles
to the new vector shuffle lowering code.

This allows us to emit PMOVZX variants consistently for patterns where
it is a viable lowering. This instruction is both fast and allows us to
fold loads into it. This only hooks the new lowering up for i16 and i8
element widths, mostly so I could manage the change to the tests. I'll
add the i32 one next, although it is significantly less interesting.

One thing to note is that we already had some tests for these patterns
but those tests had far less horrible instructions. The problem is that
those tests weren't checking the strict start and end of the instruction
sequence. =[ As a consequence something changed in the lowering making
us generate *TERRIBLE* code for these patterns in SSE2 through SSSE3.
I've consolidated all of the tests and spelled out the madness that we
currently emit for these shuffles. I'm going to try to figure out what
has gone wrong here.

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