[PATCH] D15003: Interface to attach maximum function count from PGO to module as module flags.

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 26 21:44:26 PST 2015


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.


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

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.

thanks,

David




> Thanks.
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D15003
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151126/4d88cf6c/attachment.html>


More information about the llvm-commits mailing list