@@ -75,7 +75,6 @@ RestrictStatepointRemat("restrict-statepoint-remat",
75
75
cl::desc(" Restrict remat for statepoint operands" ));
76
76
77
77
namespace {
78
-
79
78
class HoistSpillHelper : private LiveRangeEdit ::Delegate {
80
79
MachineFunction &MF;
81
80
LiveIntervals &LIS;
@@ -128,15 +127,11 @@ class HoistSpillHelper : private LiveRangeEdit::Delegate {
128
127
DenseMap<MachineBasicBlock *, unsigned > &SpillsToIns);
129
128
130
129
public:
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),
136
133
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),
140
135
IPA(LIS, mf.getNumBlockIDs()) {}
141
136
142
137
void addToMergeableSpills (MachineInstr &Spill, int StackSlot,
@@ -190,16 +185,12 @@ class InlineSpiller : public Spiller {
190
185
~InlineSpiller () override = default ;
191
186
192
187
public:
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),
198
191
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) {}
203
194
204
195
void spill (LiveRangeEdit &) override ;
205
196
ArrayRef<Register> getSpilledRegs () override { return RegsToSpill; }
@@ -237,10 +228,11 @@ Spiller::~Spiller() = default;
237
228
238
229
void Spiller::anchor () {}
239
230
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);
244
236
}
245
237
246
238
// ===----------------------------------------------------------------------===//
0 commit comments