diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp b/contrib/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp index 253cc0b0a579..c60b70ae5b69 100644 --- a/contrib/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp +++ b/contrib/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp @@ -38,12 +38,13 @@ using namespace llvm; // Explicit template instantiations and specialization definitions for core // template typedefs. namespace llvm { - static cl::opt<bool> AbortOnMaxDevirtIterationsReached( "abort-on-max-devirt-iterations-reached", cl::desc("Abort when the max iterations for devirtualization CGSCC repeat " "pass is reached")); +AnalysisKey ShouldNotRunFunctionPassesAnalysis::Key; + // Explicit instantiations for the core proxy templates. template class AllAnalysesOn<LazyCallGraph::SCC>; template class AnalysisManager<LazyCallGraph::SCC, LazyCallGraph &>; @@ -119,12 +120,6 @@ PassManager<LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, // Finally, we intersect the final preserved analyses to compute the // aggregate preserved set for this pass manager. PA.intersect(std::move(PassPA)); - - // FIXME: Historically, the pass managers all called the LLVM context's - // yield function here. We don't have a generic way to acquire the - // context and it isn't yet clear what the right pattern is for yielding - // in the new pass manager so it is currently omitted. - // ...getContext().yield(); } // Before we mark all of *this* SCC's analyses as preserved below, intersect @@ -547,6 +542,9 @@ PreservedAnalyses CGSCCToFunctionPassAdaptor::run(LazyCallGraph::SCC &C, Function &F = N->getFunction(); + if (NoRerun && FAM.getCachedResult<ShouldNotRunFunctionPassesAnalysis>(F)) + continue; + PassInstrumentation PI = FAM.getResult<PassInstrumentationAnalysis>(F); if (!PI.runBeforePass<Function>(*Pass, F)) continue; @@ -562,7 +560,9 @@ PreservedAnalyses CGSCCToFunctionPassAdaptor::run(LazyCallGraph::SCC &C, // We know that the function pass couldn't have invalidated any other // function's analyses (that's the contract of a function pass), so // directly handle the function analysis manager's invalidation here. - FAM.invalidate(F, PassPA); + FAM.invalidate(F, EagerlyInvalidate ? PreservedAnalyses::none() : PassPA); + if (NoRerun) + (void)FAM.getResult<ShouldNotRunFunctionPassesAnalysis>(F); // Then intersect the preserved set so that invalidation of module // analyses will eventually occur when the module pass completes. @@ -863,7 +863,7 @@ incorporateNewSCCRange(const SCCRangeT &NewSCCRange, LazyCallGraph &G, // split-off SCCs. // We know however that this will preserve any FAM proxy so go ahead and mark // that. - PreservedAnalyses PA; + auto PA = PreservedAnalyses::allInSet<AllAnalysesOn<Function>>(); PA.preserve<FunctionAnalysisManagerCGSCCProxy>(); AM.invalidate(*OldC, PA); |