[CGSCC][DevirtWrapper] Properly handle invalidating analyses for invalidated SCCs

f77342693 handled the adaptor and pass manager but missed the devirt wrapper.
This commit is contained in:
Arthur Eubanks 2022-09-29 09:54:10 -07:00
parent 0d5cb90f6c
commit 0cdd671df9
2 changed files with 4 additions and 7 deletions

View File

@ -413,12 +413,12 @@ PreservedAnalyses DevirtSCCRepeatedPass::run(LazyCallGraph::SCC &InitialC,
else
PI.runAfterPass<LazyCallGraph::SCC>(*Pass, *C, PassPA);
PA.intersect(PassPA);
// If the SCC structure has changed, bail immediately and let the outer
// CGSCC layer handle any iteration to reflect the refined structure.
if (UR.UpdatedC && UR.UpdatedC != C) {
PA.intersect(std::move(PassPA));
if (UR.UpdatedC && UR.UpdatedC != C)
break;
}
// If the CGSCC pass wasn't able to provide a valid updated SCC, the
// current SCC may simply need to be skipped if invalid.
@ -470,7 +470,6 @@ PreservedAnalyses DevirtSCCRepeatedPass::run(LazyCallGraph::SCC &InitialC,
}
if (!Devirt) {
PA.intersect(std::move(PassPA));
break;
}
@ -482,7 +481,6 @@ PreservedAnalyses DevirtSCCRepeatedPass::run(LazyCallGraph::SCC &InitialC,
dbgs() << "Found another devirtualization after hitting the max "
"number of repetitions ("
<< MaxIterations << ") on SCC: " << *C << "\n");
PA.intersect(std::move(PassPA));
break;
}
@ -496,8 +494,6 @@ PreservedAnalyses DevirtSCCRepeatedPass::run(LazyCallGraph::SCC &InitialC,
// Update the analysis manager with each run and intersect the total set
// of preserved analyses so we're ready to iterate.
AM.invalidate(*C, PassPA);
PA.intersect(std::move(PassPA));
}
// Note that we don't add any preserved entries here unlike a more normal

View File

@ -1,4 +1,5 @@
; RUN: opt -passes='require<no-op-module>,inline' < %s -S -debug-pass-manager 2>&1 | FileCheck %s
; RUN: opt -passes='require<no-op-module>,cgscc(devirt<1>(inline))' < %s -S -debug-pass-manager 2>&1 | FileCheck %s
; CHECK: Invalidating analysis: NoOpModuleAnalysis