@@ -75,7 +75,6 @@ RestrictStatepointRemat("restrict-statepoint-remat",
7575 cl::desc(" Restrict remat for statepoint operands" ));
7676
7777namespace {
78-
7978class HoistSpillHelper : private LiveRangeEdit ::Delegate {
8079 MachineFunction &MF;
8180 LiveIntervals &LIS;
@@ -128,15 +127,11 @@ class HoistSpillHelper : private LiveRangeEdit::Delegate {
128127 DenseMap<MachineBasicBlock *, unsigned > &SpillsToIns);
129128
130129public:
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()),
130+ HoistSpillHelper (const Spiller::RequiredAnalyses &Analyses,
131+ MachineFunction &mf, VirtRegMap &vrm)
132+ : MF(mf), LIS(Analyses.LIS), LSS(Analyses.LSS), MDT(Analyses.MDT),
136133 VRM (vrm), MRI(mf.getRegInfo()), TII(*mf.getSubtarget().getInstrInfo()),
137- TRI(*mf.getSubtarget().getRegisterInfo()),
138- MBFI(
139- pass.getAnalysis<MachineBlockFrequencyInfoWrapperPass>().getMBFI()),
134+ TRI(*mf.getSubtarget().getRegisterInfo()), MBFI(Analyses.MBFI),
140135 IPA(LIS, mf.getNumBlockIDs()) {}
141136
142137 void addToMergeableSpills (MachineInstr &Spill, int StackSlot,
@@ -190,16 +185,12 @@ class InlineSpiller : public Spiller {
190185 ~InlineSpiller () override = default ;
191186
192187public:
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()),
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),
198191 VRM (VRM), MRI(MF.getRegInfo()), TII(*MF.getSubtarget().getInstrInfo()),
199- TRI(*MF.getSubtarget().getRegisterInfo()),
200- MBFI(
201- Pass.getAnalysis<MachineBlockFrequencyInfoWrapperPass>().getMBFI()),
202- HSpiller(Pass, MF, VRM), VRAI(VRAI) {}
192+ TRI(*MF.getSubtarget().getRegisterInfo()), MBFI(Analyses.MBFI),
193+ HSpiller(Analyses, MF, VRM), VRAI(VRAI) {}
203194
204195 void spill (LiveRangeEdit &) override ;
205196 ArrayRef<Register> getSpilledRegs () override { return RegsToSpill; }
@@ -237,10 +228,11 @@ Spiller::~Spiller() = default;
237228
238229void Spiller::anchor () {}
239230
240- Spiller *llvm::createInlineSpiller (MachineFunctionPass &Pass,
241- MachineFunction &MF, VirtRegMap &VRM,
242- VirtRegAuxInfo &VRAI) {
243- return new InlineSpiller (Pass, MF, VRM, VRAI);
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);
244236}
245237
246238// ===----------------------------------------------------------------------===//
0 commit comments