diff options
author | Akshat Oke <Akshat.Oke@amd.com> | 2025-01-10 11:46:56 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-10 11:46:56 +0530 |
commit | a531800344dc54e9c197a13b22e013f919f3f5e1 (patch) | |
tree | 7095831399550ca307838f1efef87b44c896616f /llvm/lib/CodeGen/RegAllocBasic.cpp | |
parent | 6829f30883fa7e71e3b7af022916003a82f0216d (diff) | |
download | llvm-a531800344dc54e9c197a13b22e013f919f3f5e1.zip llvm-a531800344dc54e9c197a13b22e013f919f3f5e1.tar.gz llvm-a531800344dc54e9c197a13b22e013f919f3f5e1.tar.bz2 |
Spiller: Detach legacy pass and supply analyses instead (#119181)
Makes Inline Spiller amenable to the new PM.
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocBasic.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocBasic.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/RegAllocBasic.cpp b/llvm/lib/CodeGen/RegAllocBasic.cpp index c05aa1e..f3f34f8 100644 --- a/llvm/lib/CodeGen/RegAllocBasic.cpp +++ b/llvm/lib/CodeGen/RegAllocBasic.cpp @@ -22,6 +22,7 @@ #include "llvm/CodeGen/LiveRegMatrix.h" #include "llvm/CodeGen/LiveStacks.h" #include "llvm/CodeGen/MachineBlockFrequencyInfo.h" +#include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/Passes.h" @@ -187,6 +188,7 @@ void RABasic::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<ProfileSummaryInfoWrapperPass>(); AU.addRequired<MachineBlockFrequencyInfoWrapperPass>(); AU.addPreserved<MachineBlockFrequencyInfoWrapperPass>(); + AU.addRequired<MachineDominatorTreeWrapperPass>(); AU.addRequiredID(MachineDominatorsID); AU.addPreservedID(MachineDominatorsID); AU.addRequired<MachineLoopInfoWrapperPass>(); @@ -310,16 +312,20 @@ bool RABasic::runOnMachineFunction(MachineFunction &mf) { << "********** Function: " << mf.getName() << '\n'); MF = &mf; + auto &MBFI = getAnalysis<MachineBlockFrequencyInfoWrapperPass>().getMBFI(); + auto &LiveStks = getAnalysis<LiveStacksWrapperLegacy>().getLS(); + auto &MDT = getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree(); + RegAllocBase::init(getAnalysis<VirtRegMapWrapperLegacy>().getVRM(), getAnalysis<LiveIntervalsWrapperPass>().getLIS(), getAnalysis<LiveRegMatrixWrapperLegacy>().getLRM()); - VirtRegAuxInfo VRAI( - *MF, *LIS, *VRM, getAnalysis<MachineLoopInfoWrapperPass>().getLI(), - getAnalysis<MachineBlockFrequencyInfoWrapperPass>().getMBFI(), - &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI()); + VirtRegAuxInfo VRAI(*MF, *LIS, *VRM, + getAnalysis<MachineLoopInfoWrapperPass>().getLI(), MBFI, + &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI()); VRAI.calculateSpillWeightsAndHints(); - SpillerInstance.reset(createInlineSpiller(*this, *MF, *VRM, VRAI)); + SpillerInstance.reset( + createInlineSpiller({*LIS, LiveStks, MDT, MBFI}, *MF, *VRM, VRAI)); allocatePhysRegs(); postOptimization(); |