]> granicus.if.org Git - llvm/commitdiff
[X86][SSSE3] Add target shuffle constant folding tests
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 17 Sep 2016 17:40:08 +0000 (17:40 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 17 Sep 2016 17:40:08 +0000 (17:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281827 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 0d03ab0e559dc46e82cd917476f6a199461dd944..c286fd426b14db5d0ea95dac92ff4d06f060545c 100644 (file)
@@ -380,3 +380,19 @@ define <16 x i8> @combine_unpckl_arg1_pshufb(<16 x i8> %a0, <16 x i8> %a1) {
   %2 = tail call <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8> %1, <16 x i8> <i8 1, i8 -1, i8 -1, i8 -1, i8 1, i8 -1, i8 -1, i8 -1, i8 1, i8 -1, i8 -1, i8 -1, i8 1, i8 -1, i8 -1, i8 -1>)
   ret <16 x i8> %2
 }
+
+define <16 x i8> @constant_fold_pshufb() {
+; SSE-LABEL: constant_fold_pshufb:
+; SSE:       # BB#0:
+; SSE-NEXT:    movdqa {{.*#+}} xmm0 = [15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]
+; SSE-NEXT:    pshufb {{.*#+}} xmm0 = xmm0[1],zero,zero,zero,xmm0[u,u],zero,zero,xmm0[15],zero,zero,zero,zero,zero,xmm0[7,6]
+; SSE-NEXT:    retq
+;
+; AVX-LABEL: constant_fold_pshufb:
+; AVX:       # BB#0:
+; AVX-NEXT:    vmovdqa {{.*#+}} xmm0 = [15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]
+; AVX-NEXT:    vpshufb {{.*#+}} xmm0 = xmm0[1],zero,zero,zero,xmm0[u,u],zero,zero,xmm0[15],zero,zero,zero,zero,zero,xmm0[7,6]
+; AVX-NEXT:    retq
+  %1 = tail call <16 x i8> @llvm.x86.ssse3.pshuf.b.128(<16 x i8> <i8 15, i8 14, i8 13, i8 12, i8 11, i8 10, i8 9, i8 8, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0>, <16 x i8> <i8 1, i8 -1, i8 -1, i8 -1, i8 undef, i8 undef, i8 -1, i8 -1, i8 15, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 7, i8 6>)
+  ret <16 x i8> %1
+}