diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index 6ea6dbcbbb743..b87308be3419b 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();