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 {
113113 LiveIntervals (LiveIntervals &&) = default ;
114114 ~LiveIntervals ();
115115
116+ bool invalidate (MachineFunction &MF, const PreservedAnalyses &PA,
117+ MachineFunctionAnalysisManager::Invalidator &Inv);
118+
116119 // / Calculate the spill weight to assign to a single instruction.
117120 // / If \p PSI is provided the calculation is altered for optsize functions.
118121 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) {
127127
128128LiveIntervals::~LiveIntervals () { clear (); }
129129
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+
130144void LiveIntervals::clear () {
131145 // Free the live intervals themselves.
132146 for (unsigned i = 0 , e = VirtRegIntervals.size (); i != e; ++i)
You can’t perform that action at this time.
0 commit comments