Skip to content

Commit 65370e2

Browse files
committed
minor change
1 parent 425d138 commit 65370e2

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7586,14 +7586,6 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
75867586
}
75877587
}
75887588

7589-
/*
7590-
if (N2.getOpcode() == ISD::POISON) {
7591-
switch (Opcode) {
7592-
case ISD::ADD:
7593-
return getPOISON(VT);
7594-
}
7595-
}*/
7596-
75977589
// Fold a bunch of operators when the RHS is undef.
75987590
if (N2.isUndef()) {
75997591
switch (Opcode) {
@@ -7609,16 +7601,18 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
76097601
case ISD::SDIV:
76107602
case ISD::UREM:
76117603
case ISD::SREM:
7604+
// fold op(arg1, undef) -> undef, // fold op(arg1, poison) -> poison.
76127605
return N2.getOpcode() == ISD::POISON
76137606
? getPOISON(VT)
7614-
: getUNDEF(VT); // fold op(arg1, undef) -> undef
7607+
: getUNDEF(VT);
76157608
case ISD::MUL:
76167609
case ISD::AND:
76177610
case ISD::SSUBSAT:
76187611
case ISD::USUBSAT:
7612+
// fold op(arg1, undef) -> 0, fold op(arg1, poison) -> poison.
76197613
return N2.getOpcode() == ISD::POISON
76207614
? getPOISON(VT)
7621-
: getConstant(0, DL, VT); // fold op(arg1, undef) -> 0
7615+
: getConstant(0, DL, VT)
76227616
case ISD::OR:
76237617
case ISD::SADDSAT:
76247618
case ISD::UADDSAT:

0 commit comments

Comments
 (0)