diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/lib/IR/PassManager.cpp | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/IR/PassManager.cpp')
-rw-r--r-- | contrib/libs/llvm12/lib/IR/PassManager.cpp | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/contrib/libs/llvm12/lib/IR/PassManager.cpp b/contrib/libs/llvm12/lib/IR/PassManager.cpp index 8a64175049..4cf7ab2a60 100644 --- a/contrib/libs/llvm12/lib/IR/PassManager.cpp +++ b/contrib/libs/llvm12/lib/IR/PassManager.cpp @@ -91,54 +91,54 @@ bool FunctionAnalysisManagerModuleProxy::Result::invalidate( } } // namespace llvm -PreservedAnalyses ModuleToFunctionPassAdaptor::run(Module &M, - ModuleAnalysisManager &AM) { - FunctionAnalysisManager &FAM = - AM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager(); - - // Request PassInstrumentation from analysis manager, will use it to run - // instrumenting callbacks for the passes later. - PassInstrumentation PI = AM.getResult<PassInstrumentationAnalysis>(M); - - PreservedAnalyses PA = PreservedAnalyses::all(); - for (Function &F : M) { - if (F.isDeclaration()) - continue; - - // Check the PassInstrumentation's BeforePass callbacks before running the - // pass, skip its execution completely if asked to (callback returns - // false). - if (!PI.runBeforePass<Function>(*Pass, F)) - continue; - - PreservedAnalyses PassPA; - { - TimeTraceScope TimeScope(Pass->name(), F.getName()); - PassPA = Pass->run(F, FAM); - } - - PI.runAfterPass(*Pass, F, PassPA); - - // 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); - - // Then intersect the preserved set so that invalidation of module - // analyses will eventually occur when the module pass completes. - PA.intersect(std::move(PassPA)); - } - - // The FunctionAnalysisManagerModuleProxy is preserved because (we assume) - // the function passes we ran didn't add or remove any functions. - // - // We also preserve all analyses on Functions, because we did all the - // invalidation we needed to do above. - PA.preserveSet<AllAnalysesOn<Function>>(); - PA.preserve<FunctionAnalysisManagerModuleProxy>(); - return PA; -} - +PreservedAnalyses ModuleToFunctionPassAdaptor::run(Module &M, + ModuleAnalysisManager &AM) { + FunctionAnalysisManager &FAM = + AM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager(); + + // Request PassInstrumentation from analysis manager, will use it to run + // instrumenting callbacks for the passes later. + PassInstrumentation PI = AM.getResult<PassInstrumentationAnalysis>(M); + + PreservedAnalyses PA = PreservedAnalyses::all(); + for (Function &F : M) { + if (F.isDeclaration()) + continue; + + // Check the PassInstrumentation's BeforePass callbacks before running the + // pass, skip its execution completely if asked to (callback returns + // false). + if (!PI.runBeforePass<Function>(*Pass, F)) + continue; + + PreservedAnalyses PassPA; + { + TimeTraceScope TimeScope(Pass->name(), F.getName()); + PassPA = Pass->run(F, FAM); + } + + PI.runAfterPass(*Pass, F, PassPA); + + // 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); + + // Then intersect the preserved set so that invalidation of module + // analyses will eventually occur when the module pass completes. + PA.intersect(std::move(PassPA)); + } + + // The FunctionAnalysisManagerModuleProxy is preserved because (we assume) + // the function passes we ran didn't add or remove any functions. + // + // We also preserve all analyses on Functions, because we did all the + // invalidation we needed to do above. + PA.preserveSet<AllAnalysesOn<Function>>(); + PA.preserve<FunctionAnalysisManagerModuleProxy>(); + return PA; +} + AnalysisSetKey CFGAnalyses::SetKey; AnalysisSetKey PreservedAnalyses::AllAnalysesKey; |