File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,9 @@ class LiveIntervals {
113
113
LiveIntervals (LiveIntervals &&) = default ;
114
114
~LiveIntervals ();
115
115
116
+ bool invalidate (MachineFunction &MF, const PreservedAnalyses &PA,
117
+ MachineFunctionAnalysisManager::Invalidator &Inv);
118
+
116
119
// / Calculate the spill weight to assign to a single instruction.
117
120
// / If \p PSI is provided the calculation is altered for optsize functions.
118
121
static float getSpillWeight (bool isDef, bool isUse,
Original file line number Diff line number Diff line change @@ -127,6 +127,20 @@ LiveIntervalsWrapperPass::LiveIntervalsWrapperPass() : MachineFunctionPass(ID) {
127
127
128
128
LiveIntervals::~LiveIntervals () { clear (); }
129
129
130
+ bool LiveIntervals::invalidate (
131
+ MachineFunction &MF, const PreservedAnalyses &PA,
132
+ MachineFunctionAnalysisManager::Invalidator &Inv) {
133
+ auto PAC = PA.getChecker <LiveIntervalsAnalysis>();
134
+
135
+ if (!PAC.preserved () && !PAC.preservedSet <AllAnalysesOn<MachineFunction>>())
136
+ return true ;
137
+
138
+ // LiveIntervals holds pointers to these results, so check for their
139
+ // invalidation.
140
+ return Inv.invalidate <SlotIndexesAnalysis>(MF, PA) ||
141
+ Inv.invalidate <MachineDominatorTreeAnalysis>(MF, PA);
142
+ }
143
+
130
144
void LiveIntervals::clear () {
131
145
// Free the live intervals themselves.
132
146
for (unsigned i = 0 , e = VirtRegIntervals.size (); i != e; ++i)
You can’t perform that action at this time.
0 commit comments