aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/CGSCCPassManager.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2022-09-29 09:54:10 -0700
committerArthur Eubanks <aeubanks@google.com>2022-09-29 09:55:23 -0700
commit0cdd671df919974bed11293e37ac917cac55be64 (patch)
tree93a5436e3e55fbad881bdf2b2940a95a100e9f07 /llvm/lib/Analysis/CGSCCPassManager.cpp
parent0d5cb90f6c44730a74f49feb6f5b624b3414e459 (diff)
downloadllvm-0cdd671df919974bed11293e37ac917cac55be64.zip
llvm-0cdd671df919974bed11293e37ac917cac55be64.tar.gz
llvm-0cdd671df919974bed11293e37ac917cac55be64.tar.bz2
[CGSCC][DevirtWrapper] Properly handle invalidating analyses for invalidated SCCs
f77342693 handled the adaptor and pass manager but missed the devirt wrapper.
Diffstat (limited to 'llvm/lib/Analysis/CGSCCPassManager.cpp')
-rw-r--r--llvm/lib/Analysis/CGSCCPassManager.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/CGSCCPassManager.cpp b/llvm/lib/Analysis/CGSCCPassManager.cpp
index 0e96057..1edda39 100644
--- a/llvm/lib/Analysis/CGSCCPassManager.cpp
+++ b/llvm/lib/Analysis/CGSCCPassManager.cpp
@@ -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