[llvm] r358165 - [X86] SimplifyDemandedVectorElts - add VPPERM support
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 11 06:30:38 PDT 2019
Author: rksimon
Date: Thu Apr 11 06:30:38 2019
New Revision: 358165
URL: http://llvm.org/viewvc/llvm-project?rev=358165&view=rev
Log:
[X86] SimplifyDemandedVectorElts - add VPPERM support
We need to add support for all variable shuffle mask ops, but VPPERM is the only one that already has test coverage.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/oddshuffles.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=358165&r1=358164&r2=358165&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Apr 11 06:30:38 2019
@@ -33234,6 +33234,15 @@ bool X86TargetLowering::SimplifyDemanded
return true;
break;
}
+ case X86ISD::VPPERM: {
+ // TODO - simplify other variable shuffle masks.
+ SDValue Mask = Op.getOperand(2);
+ APInt MaskUndef, MaskZero;
+ if (SimplifyDemandedVectorElts(Mask, DemandedElts, MaskUndef, MaskZero, TLO,
+ Depth + 1))
+ return true;
+ break;
+ }
case X86ISD::HADD:
case X86ISD::HSUB:
case X86ISD::FHADD:
Modified: llvm/trunk/test/CodeGen/X86/oddshuffles.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/oddshuffles.ll?rev=358165&r1=358164&r2=358165&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/oddshuffles.ll (original)
+++ llvm/trunk/test/CodeGen/X86/oddshuffles.ll Thu Apr 11 06:30:38 2019
@@ -1241,7 +1241,7 @@ define void @interleave_24i16_in(<24 x i
; XOP-NEXT: vmovdqu (%rsi), %xmm0
; XOP-NEXT: vmovdqu (%rdx), %xmm1
; XOP-NEXT: vmovdqu (%rcx), %xmm2
-; XOP-NEXT: vpperm {{.*#+}} xmm3 = xmm0[4,5,6,7],xmm1[6,7],xmm0[6,7,8,9],xmm1[8,9],xmm0[8,9,10,11]
+; XOP-NEXT: vpperm {{.*#+}} xmm3 = xmm0[u,u,6,7],xmm1[6,7],xmm0[u,u,8,9],xmm1[8,9],xmm0[u,u,10,11]
; XOP-NEXT: vpshufd {{.*#+}} xmm4 = xmm2[1,1,2,2]
; XOP-NEXT: vpblendw {{.*#+}} xmm3 = xmm4[0],xmm3[1,2],xmm4[3],xmm3[4,5],xmm4[6],xmm3[7]
; XOP-NEXT: vpunpcklwd {{.*#+}} xmm4 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
More information about the llvm-commits
mailing list