[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
Fri Nov 27 05:13:55 PST 2015


On Fri, Nov 27, 2015 at 12:44 AM, Xinliang David Li <davidxl at google.com>
wrote:

>
>
> On Thu, Nov 26, 2015 at 1:34 PM, Diego Novillo <dnovillo at google.com>
> wrote:
>
>> dnovillo added a comment.
>>
>> 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.
>>
>
> 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.
>

Oh, agreed.  Setting inline hints is the only thing the profiler can do at
this time, this is why I'm interested in a per-callsite solution.  I want
to make sure that this change is taking us in that direction.  We will also
need to undo the inline hint setting done in CodeGenPGO.cpp.


>
>
>>
>> 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?
>>
>>
> 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.
>

So, the units do not matter.  This is just a number.  Higher values mean
hotter functions.  Easwaran, could you add documentation to this effect?
Thanks.

This API only sets the max entry count for the function.  How do we set the
per-callsite counts?  SamplePGO has this information now but does not know
what to do with it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151127/c5ee0761/attachment.html>


More information about the llvm-commits mailing list