From: Simon Pilgrim Date: Sat, 11 Jun 2016 13:18:21 +0000 (+0000) Subject: [X86][AVX2] Added PSLLDQ/PSRLDQ shuffle combining tests X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5221b096724d8dd83ce04de04e8a7a6598722578;p=llvm [X86][AVX2] Added PSLLDQ/PSRLDQ shuffle combining tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272469 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/X86/vector-shuffle-combining-avx2.ll b/test/CodeGen/X86/vector-shuffle-combining-avx2.ll index fc8cce04e46..553a9ac1bf3 100644 --- a/test/CodeGen/X86/vector-shuffle-combining-avx2.ll +++ b/test/CodeGen/X86/vector-shuffle-combining-avx2.ll @@ -5,6 +5,28 @@ declare <8 x i32> @llvm.x86.avx2.permd(<8 x i32>, <8 x i32>) declare <8 x float> @llvm.x86.avx2.permps(<8 x float>, <8 x i32>) declare <32 x i8> @llvm.x86.avx2.pshuf.b(<32 x i8>, <32 x i8>) +define <32 x i8> @combine_pshufb_pslldq(<32 x i8> %a0) { +; CHECK-LABEL: combine_pshufb_pslldq: +; CHECK: # BB#0: +; CHECK-NEXT: vpshufb {{.*#+}} ymm0 = zero,zero,zero,zero,zero,zero,zero,zero,ymm0[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[16,17,18,19,20,21,22,23] +; CHECK-NEXT: vpslldq {{.*#+}} ymm0 = zero,zero,zero,zero,zero,zero,zero,zero,ymm0[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[16,17,18,19,20,21,22,23] +; CHECK-NEXT: retq + %1 = tail call <32 x i8> @llvm.x86.avx2.pshuf.b(<32 x i8> %a0, <32 x i8> ) + %2 = shufflevector <32 x i8> %1, <32 x i8> zeroinitializer, <32 x i32> + ret <32 x i8> %2 +} + +define <32 x i8> @combine_pshufb_psrldq(<32 x i8> %a0) { +; CHECK-LABEL: combine_pshufb_psrldq: +; CHECK: # BB#0: +; CHECK-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[24,25,26,27,28,29,30,31],zero,zero,zero,zero,zero,zero,zero,zero +; CHECK-NEXT: vpsrldq {{.*#+}} ymm0 = ymm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[24,25,26,27,28,29,30,31],zero,zero,zero,zero,zero,zero,zero,zero +; CHECK-NEXT: retq + %1 = tail call <32 x i8> @llvm.x86.avx2.pshuf.b(<32 x i8> %a0, <32 x i8> ) + %2 = shufflevector <32 x i8> %1, <32 x i8> zeroinitializer, <32 x i32> + ret <32 x i8> %2 +} + define <32 x i8> @combine_pshufb_vpermd(<8 x i32> %a) { ; CHECK-LABEL: combine_pshufb_vpermd: ; CHECK: # BB#0: