<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Dec 2, 2015 at 2:08 PM, Easwaran Raman <span dir="ltr"><<a href="mailto:eraman@google.com" target="_blank" class="cremed">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">To further add to David's replies, without something like this, it is difficult to say whether a function 'foo' with an entry count of 1000 corresponds to a hot function or not: it is obviously hot if the max function entry count itself is 1000 (then foo is the hottest function), but perhaps not hot if the max function entry count is 1 million. The frontend uses this value to set cold and inline-hint attributes, and the purpose of this patch is to make this available to the optmizer.</div></blockquote><div><br></div><div>Right.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I think we eventually want to use this (or max BB count) to find per-callsite hotness and inline hot callsites, but perhaps an intermediate step is to continue use the current heuristic of boosting hot callees, but make that determination in the inliner instead of relying on attribute set by the frontend.<br></div></div></blockquote><div><br></div><div>From SamplePGO's perspective, I need the ability to pass on the inliner samples collected at each callsite.  This way, if a function foo() has 1M samples at its entry count spread over several callsites, I can specify the weight/count/samples for each callsite so that the inliner can make a more fine-grained decision than "function foo() is hot".</div><div><br></div><div>The same is true for instrumented PGO.</div><div><br></div><div>Diego.</div></div></div></div>