-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[SelectionDAG] Propagate poison in getNode with two operands if the input is poison. #135387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
273f4de
bea1bbd
24661e2
bd1e9e9
f0b06ba
7c196c5
a6e0c88
24bc9f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7601,16 +7601,23 @@ 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. | ||
diggerlin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return N2.getOpcode() == ISD::POISON | ||
| ? getPOISON(VT) | ||
| : getUNDEF(VT); | ||
| case ISD::MUL: | ||
| case ISD::AND: | ||
| case ISD::SSUBSAT: | ||
| case ISD::USUBSAT: | ||
| return getConstant(0, DL, VT); // fold op(arg1, undef) -> 0 | ||
| // fold op(arg1, undef) -> 0, fold op(arg1, poison) -> poison. | ||
| return N2.getOpcode() == ISD::POISON | ||
| ? getPOISON(VT) | ||
|
||
| : getConstant(0, DL, VT); | ||
| case ISD::OR: | ||
| case ISD::SADDSAT: | ||
| case ISD::UADDSAT: | ||
| return getAllOnesConstant(DL, VT); | ||
| return N2.getOpcode() == ISD::POISON ? getPOISON(VT) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: maybe we can add a similar comment, like the other cases? |
||
| : getAllOnesConstant(DL, VT); | ||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.