[llvm] [NewPM] LiveIntervals: Check dependencies for invalidation (PR #123563)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 20 03:49:50 PST 2025
================
@@ -127,6 +127,20 @@ LiveIntervalsWrapperPass::LiveIntervalsWrapperPass() : MachineFunctionPass(ID) {
LiveIntervals::~LiveIntervals() { clear(); }
+bool LiveIntervals::invalidate(
+ MachineFunction &MF, const PreservedAnalyses &PA,
+ MachineFunctionAnalysisManager::Invalidator &Inv) {
+ auto PAC = PA.getChecker<LiveIntervalsAnalysis>();
+
+ if (!PAC.preserved() && !PAC.preservedSet<AllAnalysesOn<MachineFunction>>())
+ return true;
+
+ // LiveIntervals holds pointers to these results, so check for their
+ // invalidation.
+ return (Inv.invalidate<SlotIndexesAnalysis>(MF, PA) ||
+ Inv.invalidate<MachineDominatorTreeAnalysis>(MF, PA));
+}
----------------
paperchalice wrote:
Then
```c++
PreservedAnalyses SomePass::run(IRUnitT &, AnalysisManager &) {
PreservedAnalyses PA;
PA.preserve<LiveIntervals>();
return PA;
}
```
will no longer work, which is counter-intuitive... because it doesn't preserve `SlotIndexes` explicitly.
https://github.com/llvm/llvm-project/pull/123563
More information about the llvm-commits
mailing list