Skip to content

Commit a97826a

Browse files
authored
[DAG] canCreateUndefOrPoison - explicitly state the AssertSext/Zext/Align/NoFPClass can create poison. NFC. (#146493)
This keeps getting forgotten (e.g. #66603) - so make a point of adding it here to make it clear instead of relying on the implicit default of returning true.
1 parent 43d2486 commit a97826a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5522,6 +5522,13 @@ bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, const APInt &DemandedElts,
55225522

55235523
unsigned Opcode = Op.getOpcode();
55245524
switch (Opcode) {
5525+
case ISD::AssertSext:
5526+
case ISD::AssertZext:
5527+
case ISD::AssertAlign:
5528+
case ISD::AssertNoFPClass:
5529+
// Assertion nodes can create poison if the assertion fails.
5530+
return true;
5531+
55255532
case ISD::FREEZE:
55265533
case ISD::CONCAT_VECTORS:
55275534
case ISD::INSERT_SUBVECTOR:

0 commit comments

Comments
 (0)