[x86] Fix terrible bugs everywhere in the new vector shuffle lowering
authorChandler Carruth <chandlerc@gmail.com>
Sat, 27 Sep 2014 04:42:44 +0000 (04:42 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 27 Sep 2014 04:42:44 +0000 (04:42 +0000)
commit72c3b07dfd6ece452716ae317a7c4ab14769e4f8
tree583d9017193f9fbc349499204067aee74b4952ed
parent8470b5b81270f528676b955ee4e1ff15ff3a7a55
[x86] Fix terrible bugs everywhere in the new vector shuffle lowering
and in the target shuffle combining when trying to widen vector
elements.

Previously only one of these was correct, and we didn't correctly
propagate zeroing target shuffle masks (which have a different sentinel
value from undef in non- target shuffle masks now). This isn't just
a missed optimization, this caused us to drop zeroing shuffles on the
floor and miscompile code. The added test case is one example of that.

There are other fixes to the test suite as a consequence of this as well
as restoring the undef elements in some of the masks that were lost when
I brought sanity to the actual *value* of the undef and zero sentinels.

I've also just cleaned up some of the PSHUFD and PSHUFLW and PSHUFHW
combining code, but that code really needs to go. It was a nice initial
attempt, but it isn't very principled and the recursive shuffle combiner
is much more powerful.

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