diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-03-20 11:40:34 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-05-14 11:43:05 +0000 |
commit | 349cc55c9796c4596a5b9904cd3281af295f878f (patch) | |
tree | 410c5a785075730a35f1272ca6a7adf72222ad03 /contrib/llvm-project/llvm/lib/Analysis/CGSCCPassManager.cpp | |
parent | cb2ae6163174b90e999326ecec3699ee093a5d43 (diff) | |
parent | c0981da47d5696fe36474fcf86b4ce03ae3ff818 (diff) |
Merge llvm-project main llvmorg-14-init-10186-gff7f2cfa959b
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10186-gff7f2cfa959b.
PR: 261742
MFC after: 2 weeks
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); |