mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
[X86] isGuaranteedNotToBeUndefOrPoison - add simple target shuffles with known test coverage (#161553)
Add a number of simple target shuffles (fixed shuffle mask or simple immediate control) to isGuaranteedNotToBeUndefOrPoison/canCreateUndefOrPoisonForTargetNode that have known test coverage and obviously don't introduce undef/poison. These were found by adding an assert for unhandled target shuffles and running over CodeGen/X86 - providing explicit test coverage is incredibly difficult as ISD::VECTOR_SHUFFLE nodes will typically handle freeze nodes before we lower to these target shuffle nodes.
This commit is contained in:
@@ -45022,11 +45022,16 @@ bool X86TargetLowering::isGuaranteedNotToBeUndefOrPoisonForTargetNode(
|
||||
case X86ISD::INSERTPS:
|
||||
case X86ISD::BLENDI:
|
||||
case X86ISD::PSHUFB:
|
||||
case X86ISD::VZEXT_MOVL:
|
||||
case X86ISD::PSHUFD:
|
||||
case X86ISD::PSHUFHW:
|
||||
case X86ISD::PSHUFLW:
|
||||
case X86ISD::SHUFP:
|
||||
case X86ISD::UNPCKL:
|
||||
case X86ISD::UNPCKH:
|
||||
case X86ISD::VPERMILPV:
|
||||
case X86ISD::VPERMILPI:
|
||||
case X86ISD::VPERMI:
|
||||
case X86ISD::VPERMV:
|
||||
case X86ISD::VPERMV3: {
|
||||
SmallVector<int, 8> Mask;
|
||||
@@ -45052,6 +45057,16 @@ bool X86TargetLowering::isGuaranteedNotToBeUndefOrPoisonForTargetNode(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case X86ISD::VBROADCAST: {
|
||||
SDValue Src = Op.getOperand(0);
|
||||
MVT SrcVT = Src.getSimpleValueType();
|
||||
if (SrcVT.isVector()) {
|
||||
APInt DemandedSrc = APInt::getOneBitSet(SrcVT.getVectorNumElements(), 0);
|
||||
return DAG.isGuaranteedNotToBeUndefOrPoison(Src, DemandedSrc, PoisonOnly,
|
||||
Depth + 1);
|
||||
}
|
||||
return DAG.isGuaranteedNotToBeUndefOrPoison(Src, PoisonOnly, Depth + 1);
|
||||
}
|
||||
}
|
||||
return TargetLowering::isGuaranteedNotToBeUndefOrPoisonForTargetNode(
|
||||
Op, DemandedElts, DAG, PoisonOnly, Depth);
|
||||
@@ -45096,13 +45111,19 @@ bool X86TargetLowering::canCreateUndefOrPoisonForTargetNode(
|
||||
// SSE target shuffles.
|
||||
case X86ISD::INSERTPS:
|
||||
case X86ISD::PSHUFB:
|
||||
case X86ISD::VZEXT_MOVL:
|
||||
case X86ISD::PSHUFD:
|
||||
case X86ISD::PSHUFHW:
|
||||
case X86ISD::PSHUFLW:
|
||||
case X86ISD::SHUFP:
|
||||
case X86ISD::UNPCKL:
|
||||
case X86ISD::UNPCKH:
|
||||
case X86ISD::VPERMILPV:
|
||||
case X86ISD::VPERMILPI:
|
||||
case X86ISD::VPERMI:
|
||||
case X86ISD::VPERMV:
|
||||
case X86ISD::VPERMV3:
|
||||
case X86ISD::VBROADCAST:
|
||||
return false;
|
||||
// SSE comparisons handle all icmp/fcmp cases.
|
||||
// TODO: Add CMPM/MM with test coverage.
|
||||
|
||||
Reference in New Issue
Block a user