<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 6, 2016, at 1:12 PM, Rong Xu <<a href="mailto:xur@google.com" class="">xur@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Apr 6, 2016 at 12:46 PM, Mehdi AMINI <span dir="ltr" class=""><<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">joker.eph added inline comments.<br class="">
<br class="">
================<br class="">
</span>Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:383<br class="">
@@ -380,1 +382,3 @@<br class="">
+    MPM.add(createPGOIndirectCallPromotionPass());<br class="">
+  }<br class="">
<br class="">
----------------<br class="">
Why is it running twice in LTO mode?<br class=""></blockquote><div class="">The first one is for intra module promotions. The second one is for cross module promotion.</div><div class="">The idea is to run as many promotions in pre lto compilation (until we see a cross module target -- the targets are sorted based on the counts). I think this will save compile time for parallel build. </div></div></div></div></div></blockquote><div><br class=""></div>But do you get the same result?</div><div>I think I’ll have to dive into “how it actually works under the hood” to understand.</div><div><div><br class=""></div><div>In any case: document this for the second insertion in the PassManage Builder.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
================<br class="">
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:588<br class="">
@@ -583,1 +587,3 @@<br class="">
<br class="">
+  // Indirect call promotion. (xur)<br class="">
+  PM.add(createPGOIndirectCallPromotionPass(true));<br class="">
----------------<br class="">
What is the meaning of the "xur" here?<br class=""></blockquote><div class=""><br class=""></div><div class="">Should be removed.  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
================<br class="">
Comment at: lib/Transforms/Instrumentation/IndirectCallPromotion.cpp:534<br class="">
@@ +533,3 @@<br class="">
+<br class="">
+bool PGOIndirectCallPromotion::runOnModule(Module &M) {<br class="">
+  if (DisableICP)<br class="">
----------------<br class="">
Can you implement this in a utility function? I expect the "pass wrapper" to have a dummy runOnModule that would only call the public API.<br class=""></blockquote><div class="">Sorry, can you explain a little more? </div><div class="">Do you mean I move the current in current runOnModule to a static function and call it from runOnModule?<br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div><br class=""></div><div>Yes: decoupling pass registration and interaction with the pass manager from the "utility as a library”.</div><div>If needed we should just have to promote the static function to a non-static to have a public API for anything.</div><div>It also reduces the cost of any port to the new pass-manager.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div></div></body></html>