Skip to content

Commit bea1bbd

Browse files
committed
address comment
1 parent 273f4de commit bea1bbd

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7602,22 +7602,17 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
76027602
case ISD::UREM:
76037603
case ISD::SREM:
76047604
// fold op(arg1, undef) -> undef, // fold op(arg1, poison) -> poison.
7605-
return N2.getOpcode() == ISD::POISON
7606-
? getPOISON(VT)
7607-
: getUNDEF(VT);
7605+
return N2;
76087606
case ISD::MUL:
76097607
case ISD::AND:
76107608
case ISD::SSUBSAT:
76117609
case ISD::USUBSAT:
76127610
// fold op(arg1, undef) -> 0, fold op(arg1, poison) -> poison.
7613-
return N2.getOpcode() == ISD::POISON
7614-
? getPOISON(VT)
7615-
: getConstant(0, DL, VT);
7611+
return N2.getOpcode() == ISD::POISON ? N2 : getConstant(0, DL, VT);
76167612
case ISD::OR:
76177613
case ISD::SADDSAT:
76187614
case ISD::UADDSAT:
7619-
return N2.getOpcode() == ISD::POISON ? getPOISON(VT)
7620-
: getAllOnesConstant(DL, VT);
7615+
return N2.getOpcode() == ISD::POISON ? N2 : getAllOnesConstant(DL, VT);
76217616
}
76227617
}
76237618

0 commit comments

Comments
 (0)