This is an archive of the discontinued LLVM Phabricator instance.

[NewPM] Only invalidate modified functions' analyses in CGSCC passes + turn on eagerly invalidate analyses
AbandonedPublic

Authored by aeubanks on Nov 4 2021, 5:28 PM.

Details

Reviewers
ctetreau
Summary

Previously, any change in any function in an SCC would cause all
analyses for all functions in the SCC to be invalidated. With this
change, we now manually invalidate analyses for functions we modify,
then let the pass manager know that all function analyses should be
preserved since we've already handled function analysis invalidation.

So far this only touches the inliner, argpromotion, function-attrs, and
updateCGAndAnalysisManager(), since they are the most used.

This is part of an effort to investigate running the function
simplification pipeline less on functions we visit multiple times in the
inliner pipeline.

However, this causes major memory regressions especially on larger IR.
To counteract this, turn on the option to eagerly invalidate function
analyses. This invalidates analyses on functions immediately after
they're processed in a module or scc to function adaptor for specific
parts of the pipeline.

Overall this has mostly positive effects on compile time and positive effects on memory usage.
https://llvm-compile-time-tracker.com/compare.php?from=bd3d177fe2400fb3f17850bef6e2a3ea2cfc59cd&to=3aa75eede8ac89e574a0ec47088dee7e3ca76183&stat=instructions
https://llvm-compile-time-tracker.com/compare.php?from=bd3d177fe2400fb3f17850bef6e2a3ea2cfc59cd&to=3aa75eede8ac89e574a0ec47088dee7e3ca76183&stat=max-rss

Diff Detail

Event Timeline

aeubanks created this revision.Nov 4 2021, 5:28 PM
aeubanks requested review of this revision.Nov 4 2021, 5:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2021, 5:28 PM
aeubanks updated this revision to Diff 385122.Nov 5 2021, 10:35 AM

update tests

Herald added a project: Restricted Project. · View Herald TranscriptNov 5 2021, 10:35 AM
aeubanks abandoned this revision.Nov 5 2021, 11:51 AM