<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 3, 2017 at 1:55 PM, Easwaran Raman <span dir="ltr"><<a href="mailto:eraman@google.com" target="_blank">eraman@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Oct 3, 2017 at 1:46 PM, Teresa Johnson via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Oct 3, 2017 at 1:38 PM, Graham Yiu <span dir="ltr"><<a href="mailto:gyiu@ca.ibm.com" target="_blank">gyiu@ca.ibm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><p><font size="2">Hi Teresa,</font><br><br><font size="2">Actually, enabling the new pass manager manually seems to have solved this issue, so this problem is only valid for the old pass manager.</font></p></div></blockquote><div><br></div></span><div>It should not be an issue in the old PM either - the callsite hotness is passed via IR.</div></div></div></div></blockquote></span><div>More precisely, the function entry counts are passed via IR. With the old PM,  we don't have callsite hotness information, but callee's entry count is used to boost the threshold. </div></div></div></div></blockquote><div><br></div><div>Thanks for the clarification. (But essentially there should be no difference between the profile info in the IR in the compile step vs the link aka ThinLTO backend steps - the inliner in both cases is working off the same profile info in the IR) </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> As David mentioned, the new PM inliner does a better job of updating call hotness after inlining, but it should be there (some things might look hotter than then should, which seems to be the opposite of the problem you are hitting). Can you send me a reproducer with the old PM?</div><div><br></div><div>Teresa</div><div><div class="m_-5794127191816120250h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><p><br><br><font size="2">Thanks,</font><span><br><br><font size="2">Graham Yiu<br>LLVM Compiler Development<br>IBM Toronto Software Lab<br>Office: <a href="tel:(905)%20413-4077" value="+19054134077" target="_blank">(905) 413-4077</a>      C2-707/8200/Markham<br>Email: <a href="mailto:gyiu@ca.ibm.com" target="_blank">gyiu@ca.ibm.com</a></font><br><br></span><img width="16" height="16" src="cid:1__=8FBB0B3DDFE2A6378f9e8a93df938690918c8FB@" border="0" alt="Inactive hide details for Teresa Johnson ---10/03/2017 04:18:17 PM---On Tue, Oct 3, 2017 at 12:54 PM, Graham Yiu via llvm-dev <"><font size="2" color="#424282">Teresa Johnson ---10/03/2017 04:18:17 PM---On Tue, Oct 3, 2017 at 12:54 PM, Graham Yiu via llvm-dev < <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</font><br><br><font size="2" color="#5F5F5F">From:        </font><font size="2">Teresa Johnson <<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>></font><br><font size="2" color="#5F5F5F">To:        </font><font size="2">Graham Yiu <<a href="mailto:gyiu@ca.ibm.com" target="_blank">gyiu@ca.ibm.com</a>></font><br><font size="2" color="#5F5F5F">Cc:        </font><font size="2">llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></font><br><font size="2" color="#5F5F5F">Date:        </font><font size="2">10/03/2017 04:18 PM</font><br><font size="2" color="#5F5F5F">Subject:        </font><font size="2">Re: [llvm-dev] PGO information at LTO/thinLTO link step</font><br></p><hr width="100%" size="2" align="left" noshade style="color:#8091a5"><div><div class="m_-5794127191816120250m_1409198907759555425h5"><br><br><br><br><br>On Tue, Oct 3, 2017 at 12:54 PM, Graham Yiu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank"><u><font color="#0000FF">llvm-dev@lists.llvm.org</font></u></a>> wrote:
<ul><font size="2">Hello,</font><br><font size="2"><br>My team and I noticed that callsite hotness information is not preserved from compile to link step with LTO/thinLTO enabled. As a result, the link step inlining pass remains conservative when inlining callsites known to be hot (ie. without the 'HotCallSiteThreshold' which is set at 3000 by default). There are likely many cross-module inlining opportunities lost this way, and diminishes the benefit of using LTO/thinLTO+PGO together.</font></ul><br><br>The callsite hotness is passed via the IR, so it should be there in the LTO/ThinLTO backends (during the link step). Can you provide a reproducer where that isn't happening? <br>Teresa
<ul><br><font size="2"><br>In general, does LLVM pass profiling information through the IR to the link step other than branch probabilities and function entry counts? If not, are there plans to do so in the future? For inlining specifically, perhaps we can mark callsites with hot/cold attributes during compile step to ensure LTO inlining will give appropriate threshold bonuses/penalties.</font><br><font size="2"><br>Any thoughts/insights/comments would be appreciated.</font><br><font size="2"><br>Cheers,</font><br><font size="2"><br>Graham Yiu<br>LLVM Compiler Development<br>IBM Toronto Software Lab<br>Office: </font><a href="tel:(905)%20413-4077" target="_blank"><u><font size="2" color="#0000FF">(905) 413-4077</font></u></a><font size="2"> C2-707/8200/Markham<br>Email: </font><a href="mailto:gyiu@ca.ibm.com" target="_blank"><u><font size="2" color="#0000FF">gyiu@ca.ibm.com</font></u></a><br><br>______________________________<wbr>_________________<br>LLVM Developers mailing list<u><font color="#0000FF"><br></font></u><a href="mailto:llvm-dev@lists.llvm.org" target="_blank"><u><font color="#0000FF">llvm-dev@lists.llvm.org</font></u></a><u><font color="#0000FF"><br></font></u><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=4ST7e3kMd0GTi3w9ByK5Cw&m=843dScatsnrNnnksXYIg_bhjifer5nLwDpeZvFGhfsY&s=ophNPzRTV6yMQdp3RxwwiV4szFjf6F8lnEyy9Y5paxw&e=" target="_blank"><u><font color="#0000FF">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</font></u></a><br></ul><br><br><br>-- 
<table border="1"><tbody><tr valign="top"><td width="90" valign="middle"><font size="2" color="#555555">Teresa Johnson |</font></td><td width="105" valign="middle"><font size="2" color="#555555"> Software Engineer |</font></td><td width="136" valign="middle"><font size="2" color="#555555"> </font><a href="mailto:tejohnson@google.com" target="_blank"><u><font size="2" color="#0000FF">tejohnson@google.com</font></u></a><font size="2" color="#555555"> |</font></td><td width="71" valign="middle"><font size="2" color="#555555"> <a href="tel:(408)%20460-2413" value="+14084602413" target="_blank">408-460-2413</a></font></td></tr></tbody></table><br><br><br>
</div></div><p></p></div>
</blockquote></div></div></div><div><div class="m_-5794127191816120250h5"><br><br clear="all"><div><br></div>-- <br><div class="m_-5794127191816120250m_1409198907759555425gmail_signature" data-smartmail="gmail_signature"><span style="font-family:Times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> <a href="tel:(408)%20460-2413" value="+14084602413" target="_blank">408-460-2413</a></td></tr></tbody></table></span></div>
</div></div></div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div></div></div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><span style="font-family:Times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> 408-460-2413</td></tr></tbody></table></span></div>
</div></div>