Skip to content

Commit 3fa3e09

Browse files
authored
[X86] canCreateUndefOrPoisonForTargetNode/isGuaranteedNotToBeUndefOrPoisonForTargetNode - add X86ISD::VPERMILPV handling (#160849)
X86ISD::VPERMILPV shuffles can't create undef/poison itself, allowing us to fold freeze(vpermilps(x,y)) -> vpermilps(freeze(x),freeze(y))
1 parent 0aad055 commit 3fa3e09

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45189,6 +45189,7 @@ bool X86TargetLowering::isGuaranteedNotToBeUndefOrPoisonForTargetNode(
4518945189
case X86ISD::PSHUFD:
4519045190
case X86ISD::UNPCKL:
4519145191
case X86ISD::UNPCKH:
45192+
case X86ISD::VPERMILPV:
4519245193
case X86ISD::VPERMILPI:
4519345194
case X86ISD::VPERMV:
4519445195
case X86ISD::VPERMV3: {
@@ -45257,6 +45258,7 @@ bool X86TargetLowering::canCreateUndefOrPoisonForTargetNode(
4525745258
case X86ISD::PSHUFD:
4525845259
case X86ISD::UNPCKL:
4525945260
case X86ISD::UNPCKH:
45261+
case X86ISD::VPERMILPV:
4526045262
case X86ISD::VPERMILPI:
4526145263
case X86ISD::VPERMV:
4526245264
case X86ISD::VPERMV3:

llvm/test/CodeGen/X86/vector-shuffle-combining-avx.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,6 @@ define <8 x float> @constant_fold_vpermilvar_ps_256() {
373373
define <8 x float> @freeze_vpermilvar_ps_256(<8 x float> %a0) {
374374
; CHECK-LABEL: freeze_vpermilvar_ps_256:
375375
; CHECK: # %bb.0:
376-
; CHECK-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,3,1,2,7,6,5,4]
377-
; CHECK-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,2,3,1,7,6,5,4]
378376
; CHECK-NEXT: ret{{[l|q]}}
379377
%s0 = call <8 x float> @llvm.x86.avx.vpermilvar.ps.256(<8 x float> %a0, <8 x i32> <i32 0, i32 3, i32 1, i32 2, i32 7, i32 6, i32 5, i32 4>)
380378
%f0 = freeze <8 x float> %s0

0 commit comments

Comments
 (0)