diff options
author | Arthur Eubanks <aeubanks@google.com> | 2024-07-10 09:54:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-10 09:54:56 -0700 |
commit | 8d800e6c9014e55ff729f0237efeba246750b12c (patch) | |
tree | 1a02cb4adf809aa233a6d02f37421e162aedb077 /llvm/lib/Analysis/CGSCCPassManager.cpp | |
parent | 953c669b6e0948292455cd65c7e2d6748255039f (diff) | |
download | llvm-8d800e6c9014e55ff729f0237efeba246750b12c.zip llvm-8d800e6c9014e55ff729f0237efeba246750b12c.tar.gz llvm-8d800e6c9014e55ff729f0237efeba246750b12c.tar.bz2 |
[CGSCC] Remove CGSCCUpdateResult::InvalidatedRefSCCs (#98213)
The RefSCC that a function marked dead is in may still contain valid
SCCs that we want to visit. We rely on InvalidatedSCCs to skip SCCs
containing dead functions.
The addition of RefSCCs in CallGraphUpdater to InvalidatedRefSCCs was
causing asserts as reported in #94815. Fix some more CallGraphUpdater
function deletion methods as well.
Diffstat (limited to 'llvm/lib/Analysis/CGSCCPassManager.cpp')
-rw-r--r-- | llvm/lib/Analysis/CGSCCPassManager.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/CGSCCPassManager.cpp b/llvm/lib/Analysis/CGSCCPassManager.cpp index 24b3c6e..c32739a 100644 --- a/llvm/lib/Analysis/CGSCCPassManager.cpp +++ b/llvm/lib/Analysis/CGSCCPassManager.cpp @@ -150,9 +150,8 @@ ModuleToPostOrderCGSCCPassAdaptor::run(Module &M, ModuleAnalysisManager &AM) { SmallPriorityWorklist<LazyCallGraph::RefSCC *, 1> RCWorklist; SmallPriorityWorklist<LazyCallGraph::SCC *, 1> CWorklist; - // Keep sets for invalidated SCCs and RefSCCs that should be skipped when + // Keep sets for invalidated SCCs that should be skipped when // iterating off the worklists. - SmallPtrSet<LazyCallGraph::RefSCC *, 4> InvalidRefSCCSet; SmallPtrSet<LazyCallGraph::SCC *, 4> InvalidSCCSet; SmallDenseSet<std::pair<LazyCallGraph::Node *, LazyCallGraph::SCC *>, 4> @@ -161,7 +160,6 @@ ModuleToPostOrderCGSCCPassAdaptor::run(Module &M, ModuleAnalysisManager &AM) { SmallVector<Function *, 4> DeadFunctions; CGSCCUpdateResult UR = {CWorklist, - InvalidRefSCCSet, InvalidSCCSet, nullptr, PreservedAnalyses::all(), @@ -194,11 +192,6 @@ ModuleToPostOrderCGSCCPassAdaptor::run(Module &M, ModuleAnalysisManager &AM) { do { LazyCallGraph::RefSCC *RC = RCWorklist.pop_back_val(); - if (InvalidRefSCCSet.count(RC)) { - LLVM_DEBUG(dbgs() << "Skipping an invalid RefSCC...\n"); - continue; - } - assert(CWorklist.empty() && "Should always start with an empty SCC worklist"); @@ -1172,7 +1165,6 @@ static LazyCallGraph::SCC &updateCGAndAnalysisManagerForPass( } assert(!UR.InvalidatedSCCs.count(C) && "Invalidated the current SCC!"); - assert(!UR.InvalidatedRefSCCs.count(RC) && "Invalidated the current RefSCC!"); assert(&C->getOuterRefSCC() == RC && "Current SCC not in current RefSCC!"); // Record the current SCC for higher layers of the CGSCC pass manager now that |