[llvm] Port CodeGenPrepare to new pass manager (and BasicBlockSectionsProfil… (PR #75380)
Nick Anderson via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 2 22:26:55 PST 2024
================
@@ -1963,6 +1965,9 @@ Error PassBuilder::parsePassPipeline(ModulePassManager &MPM,
Pipeline = {{"cgscc", std::move(*Pipeline)}};
} else if (isFunctionPassName(FirstName,
FunctionPipelineParsingCallbacks)) {
+ if (FirstName == "codegenprepare") {
+ MPM.addPass(RequireAnalysisPass<ProfileSummaryAnalysis, Module>());
+ }
----------------
nickleus27 wrote:
No, I don't think getResult will work. I think PSI needs to be pre-cached using `RequireAnalysisPass<ProfileSummaryAnalysis, Module>()` in the pipeline, because we cannot request a result from an outer-scope analysis. I was having a hard time finding the right place to conditionally require ProfileSummaryAnalysis in the pipeline, so I just used this hack here. Any suggestions would be appreciated.
https://github.com/llvm/llvm-project/pull/75380
More information about the llvm-commits
mailing list