This is an archive of the discontinued LLVM Phabricator instance.

[TypePromotion] Refine fix sext/zext for promoted constant from D125294.
ClosedPublic

Authored by craig.topper on May 15 2022, 6:31 PM.

Details

Summary

Reviewing the code again, I believe the sext is needed on the LHS
or RHS for ICmp and only on the RHS for Add/Sub.

Add an opcode check before checking the operand number.

Diff Detail

Event Timeline

craig.topper created this revision.May 15 2022, 6:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2022, 6:31 PM
craig.topper requested review of this revision.May 15 2022, 6:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2022, 6:31 PM
regehr added a subscriber: regehr.May 21 2022, 2:06 PM
This revision was not accepted when it landed; it landed in state Needs Review.May 21 2022, 2:08 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.

I went ahead and pushed this to close out PR55627 which @regehr found. If we need to we can address any comments with a followup patch.