[PATCH] D36655: Move SampleProfileLoader pass before all simplification passes.

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 13 14:12:37 PDT 2017


danielcdh marked an inline comment as done.
danielcdh 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.
----------------
chandlerc wrote:
> 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.
That's a good point. Moved the InstCombine pass to the caller to make the logic clearer.


https://reviews.llvm.org/D36655





More information about the llvm-commits mailing list