This is an archive of the discontinued LLVM Phabricator instance.

[NFC][Regalloc] Introduce the RegAllocPriorityAdvisorAnalysis
ClosedPublic

Authored by Flpha0830 on Aug 29 2022, 1:52 AM.

Details

Summary

This patch introduces the priority analysis and the priority advisor,
the default implementation, and the scaffolding for introducing the
other implementations of the advisor.

Diff Detail

Event Timeline

Flpha0830 created this revision.Aug 29 2022, 1:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2022, 1:52 AM
Flpha0830 requested review of this revision.Aug 29 2022, 1:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2022, 1:52 AM

overall lgtm. in addition to the comments, also add a test similar to https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/MLRegalloc/default-eviction-advisor.ll - the idea is to check that, indeed, if the user asks for the unsupported advisor, the error message is given.

llvm/lib/CodeGen/RegAllocGreedy.cpp
2572

I think Indexes is an analysis you could just get as a dependency of the regallocpriorityadvisoranalysis. Then that'd make the constructor simpler - ideally it would be reduced to just *MF and *this - it'll make it easier to evolve: we wouldn't need to touch N derived classes every time a N+1 one would need some new parameter - they could just get it from either the greedy allocator, or the analysis manager.

Flpha0830 updated this revision to Diff 457837.Sep 3 2022, 11:05 PM

make the constuctor simpler, modify pipelines and add a test

Flpha0830 updated this revision to Diff 457839.Sep 3 2022, 11:14 PM

change format

Flpha0830 updated this revision to Diff 457843.Sep 4 2022, 12:21 AM

fix the pipeline

mtrofin accepted this revision.Sep 6 2022, 8:20 AM

lgtm

This revision is now accepted and ready to land.Sep 6 2022, 8:20 AM
This revision was automatically updated to reflect the committed changes.