diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-01-11 05:08:57 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-01-11 05:08:57 +0000 |
| commit | 292d0c796bf41927109e332903ffdcd83d5e7f25 (patch) | |
| tree | 8ce555dbffc036cce496dfbfb57bc2aba900ad2b /llvm/test | |
| parent | 9cf2679d3bb7272e1a398bf0e4fae59970c666b6 (diff) | |
| download | bcm5719-llvm-292d0c796bf41927109e332903ffdcd83d5e7f25.tar.gz bcm5719-llvm-292d0c796bf41927109e332903ffdcd83d5e7f25.zip | |
X86: Properly decode shuffle masks when the constant pool type is weird
It's possible for the constant pool entry for the shuffle mask to come
from a completely different operation. This occurs when Constants have
the same bit pattern but have different types.
Make DecodePSHUFBMask tolerant of types which, after a bitcast, are
appropriately sized vector types.
This fixes PR22188.
llvm-svn: 225597
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/X86/pshufb-mask-comments.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/pshufb-mask-comments.ll b/llvm/test/CodeGen/X86/pshufb-mask-comments.ll index 7fc9890e802..8f2617068ae 100644 --- a/llvm/test/CodeGen/X86/pshufb-mask-comments.ll +++ b/llvm/test/CodeGen/X86/pshufb-mask-comments.ll @@ -27,4 +27,14 @@ define <16 x i8> @test3(<16 x i8> %V) { ret <16 x i8> %1 } +; Test that we won't crash when the constant was reused for another instruction. + +define <16 x i8> @test4(<2 x i64>* %V) { +; CHECK-LABEL: test4 +; CHECK: pshufb {{.*}}# xmm0 = xmm0[8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7] + store <2 x i64> <i64 1084818905618843912, i64 506097522914230528>, <2 x i64>* %V, align 16 + %1 = tail call <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8> undef, <16 x i8> <i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7>) + ret <16 x i8> %1 +} + declare <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8>, <16 x i8>) nounwind readnone |

