@@ -75,6 +75,7 @@ RestrictStatepointRemat("restrict-statepoint-remat",
7575 cl::desc(" Restrict remat for statepoint operands" ));
7676
7777namespace {
78+
7879class HoistSpillHelper : private LiveRangeEdit ::Delegate {
7980 MachineFunction &MF;
8081 LiveIntervals &LIS;
@@ -127,11 +128,15 @@ class HoistSpillHelper : private LiveRangeEdit::Delegate {
127128 DenseMap<MachineBasicBlock *, unsigned > &SpillsToIns);
128129
129130public:
130- HoistSpillHelper (const Spiller::RequiredAnalyses &Analyses,
131- MachineFunction &mf, VirtRegMap &vrm)
132- : MF(mf), LIS(Analyses.LIS), LSS(Analyses.LSS), MDT(Analyses.MDT),
131+ HoistSpillHelper (MachineFunctionPass &pass, MachineFunction &mf,
132+ VirtRegMap &vrm)
133+ : MF(mf), LIS(pass.getAnalysis<LiveIntervalsWrapperPass>().getLIS()),
134+ LSS (pass.getAnalysis<LiveStacksWrapperLegacy>().getLS()),
135+ MDT(pass.getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree()),
133136 VRM(vrm), MRI(mf.getRegInfo()), TII(*mf.getSubtarget().getInstrInfo()),
134- TRI(*mf.getSubtarget().getRegisterInfo()), MBFI(Analyses.MBFI),
137+ TRI(*mf.getSubtarget().getRegisterInfo()),
138+ MBFI(
139+ pass.getAnalysis<MachineBlockFrequencyInfoWrapperPass>().getMBFI()),
135140 IPA(LIS, mf.getNumBlockIDs()) {}
136141
137142 void addToMergeableSpills (MachineInstr &Spill, int StackSlot,
@@ -185,12 +190,16 @@ class InlineSpiller : public Spiller {
185190 ~InlineSpiller () override = default ;
186191
187192public:
188- InlineSpiller (const Spiller::RequiredAnalyses &Analyses, MachineFunction &MF,
189- VirtRegMap &VRM, VirtRegAuxInfo &VRAI)
190- : MF(MF), LIS(Analyses.LIS), LSS(Analyses.LSS), MDT(Analyses.MDT),
193+ InlineSpiller (MachineFunctionPass &Pass, MachineFunction &MF, VirtRegMap &VRM,
194+ VirtRegAuxInfo &VRAI)
195+ : MF(MF), LIS(Pass.getAnalysis<LiveIntervalsWrapperPass>().getLIS()),
196+ LSS (Pass.getAnalysis<LiveStacksWrapperLegacy>().getLS()),
197+ MDT(Pass.getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree()),
191198 VRM(VRM), MRI(MF.getRegInfo()), TII(*MF.getSubtarget().getInstrInfo()),
192- TRI(*MF.getSubtarget().getRegisterInfo()), MBFI(Analyses.MBFI),
193- HSpiller(Analyses, MF, VRM), VRAI(VRAI) {}
199+ TRI(*MF.getSubtarget().getRegisterInfo()),
200+ MBFI(
201+ Pass.getAnalysis<MachineBlockFrequencyInfoWrapperPass>().getMBFI()),
202+ HSpiller(Pass, MF, VRM), VRAI(VRAI) {}
194203
195204 void spill (LiveRangeEdit &) override ;
196205 ArrayRef<Register> getSpilledRegs () override { return RegsToSpill; }
@@ -228,11 +237,10 @@ Spiller::~Spiller() = default;
228237
229238void Spiller::anchor () {}
230239
231- Spiller *
232- llvm::createInlineSpiller (const InlineSpiller::RequiredAnalyses &Analyses,
233- MachineFunction &MF, VirtRegMap &VRM,
234- VirtRegAuxInfo &VRAI) {
235- return new InlineSpiller (Analyses, MF, VRM, VRAI);
240+ Spiller *llvm::createInlineSpiller (MachineFunctionPass &Pass,
241+ MachineFunction &MF, VirtRegMap &VRM,
242+ VirtRegAuxInfo &VRAI) {
243+ return new InlineSpiller (Pass, MF, VRM, VRAI);
236244}
237245
238246// ===----------------------------------------------------------------------===//
0 commit comments