[PATCH] D15003: Interface to attach maximum function count from PGO to module as module flags.
Diego Novillo via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 2 11:37:39 PST 2015
On Wed, Dec 2, 2015 at 2:08 PM, Easwaran Raman <eraman at google.com> wrote:
> 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.
>
Right.
> 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.
>
>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".
The same is true for instrumented PGO.
Diego.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151202/fefeb73b/attachment.html>
More information about the llvm-commits
mailing list