Skip to content

Commit ac6afd8

Browse files
authored
[LegalizeDAG] Return after replacing ISD::POISON with ISD::UNDEF. (#173173)
We already replaced the node, we shouldn't run the rest of the code that still uses the old node.
1 parent 789845e commit ac6afd8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -993,18 +993,18 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) {
993993
TargetLowering::LegalizeAction Action = TargetLowering::Legal;
994994
bool SimpleFinishLegalizing = true;
995995
switch (Node->getOpcode()) {
996-
// TODO: Currently, POISON is being lowered to UNDEF here. However, there is
997-
// an open concern that this transformation may not be ideal, as targets
998-
// should ideally handle POISON directly. Changing this behavior would require
999-
// adding support for POISON in TableGen, which is a large change.
1000-
// Additionally, many existing test cases rely on the current behavior (e.g.,
1001-
// llvm/test/CodeGen/PowerPC/vec_shuffle.ll). A broader discussion and
1002-
// incremental changes might be needed to properly
1003-
// support POISON without breaking existing targets and tests.
1004996
case ISD::POISON: {
997+
// TODO: Currently, POISON is being lowered to UNDEF here. However, there is
998+
// an open concern that this transformation may not be ideal, as targets
999+
// should ideally handle POISON directly. Changing this behavior would
1000+
// require adding support for POISON in TableGen, which is a large change.
1001+
// Additionally, many existing test cases rely on the current behavior
1002+
// (e.g., llvm/test/CodeGen/PowerPC/vec_shuffle.ll). A broader discussion
1003+
// and incremental changes might be needed to properly support POISON
1004+
// without breaking existing targets and tests.
10051005
SDValue UndefNode = DAG.getUNDEF(Node->getValueType(0));
10061006
ReplaceNode(Node, UndefNode.getNode());
1007-
break;
1007+
return;
10081008
}
10091009
case ISD::INTRINSIC_W_CHAIN:
10101010
case ISD::INTRINSIC_WO_CHAIN:

0 commit comments

Comments
 (0)