This is an archive of the discontinued LLVM Phabricator instance.

[TypePromotion] Fix sext vs zext in promoted constant
ClosedPublic

Authored by dmgreen on May 10 2022, 1:29 AM.

Details

Summary

As pointed out in #55342, given non-canonical IR with multiple constants, we check the second operand in isSafeWrap, but can promote both with sext. Fix that as suggested by @craig.topper by ensuring we only extend the second constant if multiple are present.

Fixes #55342

Diff Detail

Event Timeline

dmgreen created this revision.May 10 2022, 1:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2022, 1:29 AM
dmgreen requested review of this revision.May 10 2022, 1:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2022, 1:29 AM
dmgreen edited the summary of this revision. (Show Details)May 10 2022, 1:29 AM
samparker accepted this revision.May 10 2022, 2:48 AM

LGTM, cheers

This revision is now accepted and ready to land.May 10 2022, 2:48 AM
This revision was landed with ongoing or failed builds.May 11 2022, 2:47 AM
This revision was automatically updated to reflect the committed changes.