This is an archive of the discontinued LLVM Phabricator instance.

[SCCP] Use range info to prove AddInst has NSW flag.
ClosedPublic

Authored by fhahn on Jan 23 2023, 10:49 AM.

Details

Summary

This patch updates SCCP to use the value ranges of AddInst operands to
try to prove the AddInst does not overflow in the signed sense and
adds the NSW flag. The reasoning is done with
makeGuaranteedNoWrapRegion (thanks @nikic for point it out!).

Follow-ups will include extending this to more
OverflowingBinaryOperators.

Depends on D142387.

Diff Detail

Event Timeline

fhahn created this revision.Jan 23 2023, 10:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 10:49 AM
fhahn requested review of this revision.Jan 23 2023, 10:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 10:49 AM
fhahn updated this revision to Diff 491786.Jan 24 2023, 7:21 AM

Flip ranges, as in D142387.

nikic accepted this revision.Jan 26 2023, 8:36 AM

Needs a rebase, but otherwise LG.

This revision is now accepted and ready to land.Jan 26 2023, 8:36 AM
fhahn updated this revision to Diff 492724.Jan 27 2023, 6:03 AM

rebase before landing

This revision was landed with ongoing or failed builds.Jan 27 2023, 6:10 AM
This revision was automatically updated to reflect the committed changes.