[PATCH] D31217: Disable loop unrolling and icp in SamplePGO ThinLTO compile phase

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 15:20:22 PDT 2017

mehdi_amini added inline comments.

Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:464
+  // call promotion as it will change the CFG too much to make the 2nd
+  // profile annotation in backend more difficult.
+  if (!PerformThinLTO && !(PrepareForThinLTO && !PGOSampleUse.empty())) {
danielcdh wrote:
> mehdi_amini wrote:
> > That makes me worried in some way: we're not expecting ICP and SamplePGO to be complementary from each other?
> Let me try to clarify here.
> * ICP is invoked twice in thinlto: once in compile phase to cover intra-module promotion, another in backend to handle inter-module promotion. The first icp is aiming at reduce callgraph size thus reduce the thinlink burden, but it's not required.
> * SamplePGO do interacts a lot with ICP. If an indirect call is inlined in the profile, then before annotation, we need to promote it and inline it as well. This is done before the profile annotation. But after the profile annotation, when we find more ICP opportunities, it will simply use the legacy ICP pass.
> So in this patch, instead of invoking legacy ICP pass twice, we only invoke it once in backend if it is samplepgo+thinlto build.
Oh OK I missed that it was just the early ICP. Nevermind then.


More information about the llvm-commits mailing list