<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 26, 2015 at 1:34 PM, Diego Novillo <span dir="ltr"><<a href="mailto:dnovillo@google.com" target="_blank">dnovillo@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dnovillo added a comment.<br>
<br>
How is this going to interact with SamplePGO?  Currently, I'm testing a change that adds the InlineHint attribute for functions that globally collected a fraction of samples greater than a given threshold.  Likewise, for functions that fall below another threshold, they receive the Cold attribute.<br></blockquote><div><br></div><div>Setting global max count and setting inlinehint are two different things to do. The former helps per-callsite inline decision while the later is for per-callee inline decision. Per-callee decision is not always good -- for instance you don't want to inline a function just because it is hot -- the callsite may be really cold.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The API talks in terms of function counts, how is this related to the entry count I added earlier? What would SamplePGO have to do here?<br>
<br></blockquote><div><br></div><div>The inline decision is based on the new information provided by the API and the entry count info -- from the entry count and block relative frequency, the inliner can find out the profile count of the callsite -- the callsite count is then compared with a threshold determined by the global hotness information provided by the API. </div><div><br></div><div>For samplePGO, the max sampled counts for the whole program can be used to set this value.  This is exactly profile-driven (sample or instr based) inliner needs.</div><div><br></div><div>thanks,</div><div><br></div><div>David</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D15003" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15003</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>