[PATCH] D24004: [ThinLTO] Indirect call promotion fixes for promoted local functions

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 15:48:11 PDT 2016


tejohnson added inline comments.

================
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:376
@@ -375,2 +375,3 @@
     legacy::PassManagerBase &MPM) {
+
   // Allow forcing function attributes as a debugging and tuning aid.
----------------
mehdi_amini wrote:
> Spurious empty line?
Will remove

================
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:412
@@ +411,3 @@
+  // are removed.
+  if (PerformThinLTO)
+    MPM.add(createPGOIndirectCallPromotionLegacyPass(/*InLTO = */ true));
----------------
davidxl wrote:
> tejohnson wrote:
> > davidxl wrote:
> > > Is there PGOInstr/Annotation pass before this?
> > In the compile step. PerformThinLTO is true when we are in the ThinLTO backends. See also further down where we guard the invocation of addPGOInstrPasses with !PerformThinLTO.
> Ok. Can you add a comment here documenting this: with thinLTO, there are two icall promotion pass. One is in the compile phase where PerformThinLTO is false to handle intra-module calls, the other one is here that does cross module ones?
Will do.

================
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:440
@@ -430,1 +439,3 @@
+    // for imported functions.
+    MPM.add(createPGOIndirectCallPromotionLegacyPass());
   }
----------------
mehdi_amini wrote:
> Do we want to do this in the compile phase?
Yes, we want to have one in the compile phase to catch intra-module indirect calls (that will subsequently be eligible for inlining during the compile phase).


https://reviews.llvm.org/D24004





More information about the llvm-commits mailing list