[llvm] r358173 - [X86][AVX] Add X86ISD::VPERMV demandedelts test

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 11 07:26:32 PDT 2019


Author: rksimon
Date: Thu Apr 11 07:26:32 2019
New Revision: 358173

URL: http://llvm.org/viewvc/llvm-project?rev=358173&view=rev
Log:
[X86][AVX] Add X86ISD::VPERMV demandedelts test

Modified:
    llvm/trunk/test/CodeGen/X86/vector-shuffle-combining-avx2.ll

Modified: llvm/trunk/test/CodeGen/X86/vector-shuffle-combining-avx2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vector-shuffle-combining-avx2.ll?rev=358173&r1=358172&r2=358173&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/vector-shuffle-combining-avx2.ll (original)
+++ llvm/trunk/test/CodeGen/X86/vector-shuffle-combining-avx2.ll Thu Apr 11 07:26:32 2019
@@ -342,6 +342,28 @@ define <8 x float> @combine_permps_as_pe
   ret <8 x float> %1
 }
 
+define <8 x float> @combine_permps_as_vpermilps(<8 x float> %a, i32 %a1) {
+; X86-LABEL: combine_permps_as_vpermilps:
+; X86:       # %bb.0:
+; X86-NEXT:    vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero
+; X86-NEXT:    vblendps {{.*#+}} ymm1 = ymm1[0],mem[1,2,3,4,5,6,7]
+; X86-NEXT:    vpermps %ymm0, %ymm1, %ymm0
+; X86-NEXT:    vpermilps {{.*#+}} ymm0 = ymm0[1,1,2,3,4,5,6,7]
+; X86-NEXT:    retl
+;
+; X64-LABEL: combine_permps_as_vpermilps:
+; X64:       # %bb.0:
+; X64-NEXT:    vmovd %edi, %xmm1
+; X64-NEXT:    vpblendd {{.*#+}} ymm1 = ymm1[0],mem[1,2,3,4,5,6,7]
+; X64-NEXT:    vpermd %ymm0, %ymm1, %ymm0
+; X64-NEXT:    vpermilps {{.*#+}} ymm0 = ymm0[1,1,2,3,4,5,6,7]
+; X64-NEXT:    retq
+  %1 = insertelement <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>, i32 %a1, i32 0
+  %2 = call <8 x float> @llvm.x86.avx2.permps(<8 x float> %a, <8 x i32> %1)
+  %3 = shufflevector <8 x float> %2, <8 x float> undef, <8 x i32> <i32 1, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+  ret <8 x float> %3
+}
+
 define <4 x i64> @combine_pshufb_as_zext(<32 x i8> %a0) {
 ; CHECK-LABEL: combine_pshufb_as_zext:
 ; CHECK:       # %bb.0:




More information about the llvm-commits mailing list