This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Avoid repeated proveNoSignedWrapViaInduction calls.
ClosedPublic

Authored by fhahn on Jul 28 2022, 2:51 AM.

Details

Summary

At the moment, proveNoSignedWrapViaInduction may be called for the
same AddRec a large number of times via getSignExtendExpr. This can have
a severe compile-time impact for very loop-heavy code.

If proveNoSignedWrapViaInduction failed to prove NSW the first time,
it is unlikely to succeed on subsequent tries and the cost doesn't seem
to be justified.

This is the signed version of 8daa338297d533d / D130648.

This can drastically improve compile-time in some excessive cases and
also has a slightly positive compile-time impact on CTMark:

NewPM-O3: -0.06%
NewPM-ReleaseThinLTO: -0.04%
NewPM-ReleaseLTO-g: -0.04%

https://llvm-compile-time-tracker.com/compare.php?from=8daa338297d533db4d1ae8d3770613eb25c29688&to=aed126a196e7a5a9803543d9b4d6bdb233d0009c&stat=instructions

Diff Detail

Event Timeline

fhahn created this revision.Jul 28 2022, 2:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2022, 2:51 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
fhahn requested review of this revision.Jul 28 2022, 2:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2022, 2:51 AM
This revision is now accepted and ready to land.Jul 28 2022, 3:26 AM
This revision was landed with ongoing or failed builds.Jul 29 2022, 1:15 AM
This revision was automatically updated to reflect the committed changes.