From d46305e22d15de4e403b40a61ab99017e2f62437 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Mon, 31 Jan 2022 14:01:43 -0800 Subject: [PATCH] [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. --- llvm/lib/CodeGen/RegAllocGreedy.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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().getAdvisor(*MF, *this); + VRAI = std::make_unique(*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().getAdvisor(*MF, *this); + IntfCache.init(MF, Matrix->getLiveUnions(), Indexes, LIS, TRI); GlobalCand.resize(32); // This will grow as needed. SetOfBrokenHints.clear();