[llvm] r358167 - [X86] SimplifyDemandedVectorElts - add X86ISD::VPERMIL2 mask support

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


Author: rksimon
Date: Thu Apr 11 07:04:19 2019
New Revision: 358167

URL: http://llvm.org/viewvc/llvm-project?rev=358167&view=rev
Log:
[X86] SimplifyDemandedVectorElts - add X86ISD::VPERMIL2 mask support

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/test/CodeGen/X86/vector-shuffle-combining-xop.ll

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=358167&r1=358166&r2=358167&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Apr 11 07:04:19 2019
@@ -33234,8 +33234,8 @@ bool X86TargetLowering::SimplifyDemanded
       return true;
     break;
   }
-  case X86ISD::VPPERM: {
-    // TODO - simplify other variable shuffle masks.
+  case X86ISD::VPPERM:
+  case X86ISD::VPERMIL2: {
     SDValue Mask = Op.getOperand(2);
     APInt MaskUndef, MaskZero;
     if (SimplifyDemandedVectorElts(Mask, DemandedElts, MaskUndef, MaskZero, TLO,

Modified: llvm/trunk/test/CodeGen/X86/vector-shuffle-combining-xop.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vector-shuffle-combining-xop.ll?rev=358167&r1=358166&r2=358167&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/vector-shuffle-combining-xop.ll (original)
+++ llvm/trunk/test/CodeGen/X86/vector-shuffle-combining-xop.ll Thu Apr 11 07:04:19 2019
@@ -153,23 +153,13 @@ define <4 x double> @demandedelts_vpermi
 ; X86-AVX2-NEXT:    vpermilpd {{.*#+}} ymm0 = ymm0[1,1,2,3]
 ; X86-AVX2-NEXT:    retl
 ;
-; X64-AVX-LABEL: demandedelts_vpermil2pd256_as_shufpd:
-; X64-AVX:       # %bb.0:
-; X64-AVX-NEXT:    vmovdqa {{.*#+}} xmm2 = <u,4,2,7>
-; X64-AVX-NEXT:    vpinsrq $0, %rdi, %xmm2, %xmm2
-; X64-AVX-NEXT:    vblendpd {{.*#+}} ymm2 = ymm2[0,1],mem[2,3]
-; X64-AVX-NEXT:    vpermil2pd $0, %ymm2, %ymm1, %ymm0, %ymm0
-; X64-AVX-NEXT:    vpermilpd {{.*#+}} ymm0 = ymm0[1,1,2,3]
-; X64-AVX-NEXT:    retq
-;
-; X64-AVX2-LABEL: demandedelts_vpermil2pd256_as_shufpd:
-; X64-AVX2:       # %bb.0:
-; X64-AVX2-NEXT:    vmovdqa {{.*#+}} xmm2 = <u,4,2,7>
-; X64-AVX2-NEXT:    vpinsrq $0, %rdi, %xmm2, %xmm2
-; X64-AVX2-NEXT:    vpblendd {{.*#+}} ymm2 = ymm2[0,1,2,3],mem[4,5,6,7]
-; X64-AVX2-NEXT:    vpermil2pd $0, %ymm2, %ymm1, %ymm0, %ymm0
-; X64-AVX2-NEXT:    vpermilpd {{.*#+}} ymm0 = ymm0[1,1,2,3]
-; X64-AVX2-NEXT:    retq
+; X64-LABEL: demandedelts_vpermil2pd256_as_shufpd:
+; X64:       # %bb.0:
+; X64-NEXT:    vmovapd {{.*#+}} xmm2 = <u,4,2,7>
+; X64-NEXT:    vblendpd {{.*#+}} ymm2 = ymm2[0,1],mem[2,3]
+; X64-NEXT:    vpermil2pd $0, %ymm2, %ymm1, %ymm0, %ymm0
+; X64-NEXT:    vpermilpd {{.*#+}} ymm0 = ymm0[1,1,2,3]
+; X64-NEXT:    retq
   %res0 = insertelement <4 x i64> <i64 0, i64 4, i64 2, i64 7>, i64 %a2, i32 0
   %res1 = call <4 x double> @llvm.x86.xop.vpermil2pd.256(<4 x double> %a0, <4 x double> %a1, <4 x i64> %res0, i8 0)
   %res2 = shufflevector <4 x double> %res1, <4 x double> undef, <4 x i32> <i32 1, i32 1, i32 2, i32 3>




More information about the llvm-commits mailing list