[x86] Fix a miscompile in the new shuffle lowering found through the new
authorChandler Carruth <chandlerc@gmail.com>
Thu, 7 Aug 2014 08:11:31 +0000 (08:11 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 7 Aug 2014 08:11:31 +0000 (08:11 +0000)
commit15d82b7d33812d0df391c50e524d789f00fa4a4d
tree633519de1194964197e15d54ed01c649421a2b94
parente216468fef48e65be424f1ec99efe6d95de54b35
[x86] Fix a miscompile in the new shuffle lowering found through the new
fuzz testing.

The function which tested for adjacency did what it said on the tin, but
when I called it, I wanted it to do something more thorough: I wanted to
know if the *pairs* of shuffle elements were adjacent and started at
0 mod 2. In one place I had the decency to try to test for this, but in
the other it was completely skipped, miscompiling this test case. Fix
this by making the helper actually do what I wanted it to do everywhere
I called it (and removing the now redundant code in one place).

I *really* dislike the name "canWidenShuffleElements" for this
predicate. If anyone can come up with a better name, please let me know.
The other name I thought about was "canWidenShuffleMask" but is it
really widening the mask to reduce the number of lanes shuffled? I don't
know. Naming things is hard.

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