[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM
Hans Wennborg via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 7 02:16:27 PDT 2020
hans added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/PassManagerBuilder.cpp:170
PassManagerBuilder::PassManagerBuilder() {
OptLevel = 2;
----------------
Oh, just noticed: I think CallGraphProfile should be initialized along with the other flags here.
================
Comment at: llvm/test/Other/opt-O2-pipeline.ll:289
+; CHECK-NEXT: Branch Probability Analysis
+; CHECK-NEXT: Block Frequency Analysis
; CHECK-NEXT: FunctionPass Manager
----------------
nikic wrote:
> Is it possible to switch this pass to use LazyBPI / LazyBFA, only fetched if PGO is actually in use?
>
> PGO functionality that most people don't use adding expensive analysis passes like PDT should be avoided.
I wonder if just switching to LazyBlockFrequencyInfo would help though. It looks to me like the CGProfile would request info about each function anyway.
I was surprised to see that Clang sets Opts.CallGraphProfile solely based on whether the integrated assembler is used. Maybe a better fix is to only set that to true when a profile is actually being used?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83013/new/
https://reviews.llvm.org/D83013
More information about the cfe-commits
mailing list