]> granicus.if.org Git - llvm/commitdiff
[X86][SSSE3] Missing combine opportunity to simplify to a MOVQ shuffle
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 3 May 2016 13:12:44 +0000 (13:12 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 3 May 2016 13:12:44 +0000 (13:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268378 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/X86/vector-shuffle-combining-ssse3.ll

index 0f1cae42d10f7626c1813c23b5e97344f1d56ec4..b98141377e00943b298f9d37c8ebc9bdbd9aa630 100644 (file)
@@ -25,6 +25,21 @@ define <16 x i8> @combine_vpshufb_zero(<16 x i8> %a0) {
   ret <16 x i8> %res2
 }
 
+define <16 x i8> @combine_vpshufb_movq(<16 x i8> %a0) {
+; SSE-LABEL: combine_vpshufb_movq:
+; SSE:       # BB#0:
+; SSE-NEXT:    pshufb {{.*#+}} xmm0 = xmm0[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero
+; SSE-NEXT:    retq
+;
+; AVX-LABEL: combine_vpshufb_movq:
+; AVX:       # BB#0:
+; AVX-NEXT:    vpshufb {{.*#+}} xmm0 = xmm0[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero
+; AVX-NEXT:    retq
+  %res0 = call <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8> %a0, <16 x i8> <i8 0, i8 128, i8 1, i8 128, i8 2, i8 128, i8 3, i8 128, i8 4, i8 128, i8 5, i8 128, i8 6, i8 128, i8 7, i8 128>)
+  %res1 = call <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8> %res0, <16 x i8> <i8 0, i8 2, i8 4, i8 6, i8 8, i8 10, i8 12, i8 14, i8 1, i8 3, i8 5, i8 7, i8 9, i8 11, i8 13, i8 15>)
+  ret <16 x i8> %res1
+}
+
 define <4 x float> @combine_pshufb_movddup(<4 x float> %a0) {
 ; SSE-LABEL: combine_pshufb_movddup:
 ; SSE:       # BB#0: