OSDN Git Service

[x86] Fix a crasher due to shuffles which cancel each other out and add
authorChandler Carruth <chandlerc@gmail.com>
Tue, 5 Aug 2014 18:45:49 +0000 (18:45 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 5 Aug 2014 18:45:49 +0000 (18:45 +0000)
commitfadc91beecb7ce760d21fadbc2adc972ac91188c
tree26d0f3438b2477923356ba58fd76de22435cbb6f
parentb72118fb52a5d7e8d2a800a7b00718e0210a34f5
[x86] Fix a crasher due to shuffles which cancel each other out and add
a test case.

We also miscompile this test case which is showing a serious flaw in the
single-input v8i16 shuffle code. I've left the specific instruction
checks FIXME-ed out until I can address the bug in the single-input
code, but I wanted to separate out a significant functionality change to
produce correct code from a very simple and targeted crasher fix.

The miscompile problem stems from keeping track of inputs by value
rather than by index. As a consequence of doing this, we can't reliably
update those inputs because they might swap and we can't detect this
without copying the mask.

The blend code now uses indices for the input lists and this seems
strictly better. It also should make it easier to sort things and do
other cleanups. I think the time has come to simplify The Great Lambda
here.

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