[llvm] d46305e - [NFC][regalloc] Move evict advisor initialization before VRAI
Mircea Trofin via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 31 14:05:11 PST 2022
Author: Mircea Trofin
Date: 2022-01-31T14:04:59-08:00
New Revision: d46305e22d15de4e403b40a61ab99017e2f62437
URL: https://github.com/llvm/llvm-project/commit/d46305e22d15de4e403b40a61ab99017e2f62437
DIFF: https://github.com/llvm/llvm-project/commit/d46305e22d15de4e403b40a61ab99017e2f62437.diff
LOG: [NFC][regalloc] Move evict advisor initialization before VRAI
This is because a subsequent patch will propose obtaining the VRAI from
the advisor, which will enable feature caching for the ML advisor, for
better compile time. Making this change first as it's both innocuous and
keeps the future patch to be reviewed small.
Added:
Modified:
llvm/lib/CodeGen/RegAllocGreedy.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp
index 6ea6dbcbbb74..b87308be3419 100644
--- a/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -2922,6 +2922,10 @@ bool RAGreedy::runOnMachineFunction(MachineFunction &mf) {
RegCosts = TRI->getRegisterCosts(*MF);
+ ExtraInfo.emplace();
+ EvictAdvisor =
+ getAnalysis<RegAllocEvictionAdvisorAnalysis>().getAdvisor(*MF, *this);
+
VRAI = std::make_unique<VirtRegAuxInfo>(*MF, *LIS, *VRM, *Loops, *MBFI);
SpillerInstance.reset(createInlineSpiller(*this, *MF, *VRM, *VRAI));
@@ -2931,9 +2935,7 @@ bool RAGreedy::runOnMachineFunction(MachineFunction &mf) {
SA.reset(new SplitAnalysis(*VRM, *LIS, *Loops));
SE.reset(new SplitEditor(*SA, *AA, *LIS, *VRM, *DomTree, *MBFI, *VRAI));
- ExtraInfo.emplace();
- EvictAdvisor =
- getAnalysis<RegAllocEvictionAdvisorAnalysis>().getAdvisor(*MF, *this);
+
IntfCache.init(MF, Matrix->getLiveUnions(), Indexes, LIS, TRI);
GlobalCand.resize(32); // This will grow as needed.
SetOfBrokenHints.clear();
More information about the llvm-commits
mailing list