[llvm] [SelectionDAG] Propagate poison in getNode with two operands if the input is poison. (PR #135387)
Amy Kwan via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 16 10:31:37 PDT 2025
================
@@ -7601,16 +7604,20 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
case ISD::SDIV:
case ISD::UREM:
case ISD::SREM:
- return getUNDEF(VT); // fold op(arg1, undef) -> undef
+ // fold op(arg1, undef) -> undef, // fold op(arg1, poison) -> poison.
----------------
amy-kwan wrote:
Comment nit.
```suggestion
// fold op(arg1, undef) -> undef, fold op(arg1, poison) -> poison.
```
https://github.com/llvm/llvm-project/pull/135387
More information about the llvm-commits
mailing list