This is an archive of the discontinued LLVM Phabricator instance.

[LV][WIP] Lazy creation of BFI when required by cost model
Needs ReviewPublic

Authored by ebrevnov on Jul 20 2023, 5:59 AM.

Details

Summary
NOTE: just shows the concept, not to be committed as is

This patch introduces utility class which helps to request analysis in a lazy fashion. It automatically manages invalidation and updates of predefined set of analysis behind the scene. JumpThreading already uses the same idea but has implementation covering its needs only. This is an attempt to generalize the solution so it can be used in other similar cases. It doesn't replace existing functionality of analysis managers. Instead it introduces a convenient way to have a local cache of analysis results (aka. LoopInfo* LI class member) that automatically updated when needed. The benefit of having such an utility class (as opposite to using analysis manager API directly) is minimized probability of introducing new bugs due to well defined API and extra internal verifications.

Please let me know if like the idea or not. If I have a green light I can split this patch and introduce new functionality by steps.

Diff Detail

Event Timeline

ebrevnov created this revision.Jul 20 2023, 5:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 5:59 AM
ebrevnov requested review of this revision.Jul 20 2023, 5:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 5:59 AM
ebrevnov edited the summary of this revision. (Show Details)Jul 20 2023, 6:46 AM
ebrevnov added reviewers: nikic, fhahn, aeubanks.
ebrevnov updated this revision to Diff 542497.Jul 20 2023, 6:47 AM

Removed acidental changes

Any feedback?

fhahn added a comment.Aug 30 2023, 8:27 AM

Just to make sure I understand the motivation for this: the goal is to only request BFI and PSI when the cost-model actually uses them to save compile time for cases which aren't vectorizable according to Legal for example?