[PATCH] D36655: Move SampleProfileLoader pass before all simplification passes.
Chandler Carruth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 13 13:57:22 PDT 2017
chandlerc added inline comments.
================
Comment at: lib/Passes/PassBuilder.cpp:536-539
if (PGOOpt && !PGOOpt->SampleProfileFile.empty()) {
+ // In SamplePGO ThinLTO backend, we need instcombine before profile
+ // annotation to convert bitcast to direct calls so that they can be
+ // inlined during the profile annotation prepration step.
----------------
Since you're now adding the only cleanup you need before loading the sample profile, can't you lift this back into the caller to simplify things? (Or does that not simplify things any more?)
I'm happy for that to be a separate patch if you want to see what the performance numbers end up looking like first.
================
Comment at: lib/Passes/PassBuilder.cpp:545-546
+ MPM.addPass(createModuleToFunctionPassAdaptor(InstCombinePass()));
// Annotate sample profile right after early FPM to ensure freshness of
// the debug info.
MPM.addPass(SampleProfileLoaderPass(PGOOpt->SampleProfileFile));
----------------
This comment needs updating
https://reviews.llvm.org/D36655
More information about the llvm-commits
mailing list