[PATCH] D28369: Refactor inline threshold update code.

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 6 15:37:00 PST 2017


eraman added a comment.

In https://reviews.llvm.org/D28369#638393, @davidxl wrote:

> Should we honor optForMinSize for HotCallsite case as well?


Yes, unless and until someone tunes PGO + -Os case.

> I also suggest split the source hint based check from the profile driven check.  Also check hotcallsite first:
> 
> if (!Caller->optForMinSize() ) {
> 
>   if (...InlineHint)
>     Threshold = MaxIfValid (...);
>    
>   if (HotCallsite)
>      ...
>   else if (HotCallee) 
>     ..
> 
> }

Note that HotCallsite and HotCallee are mutually exclusive and if the callsite is hot that takes precedence over HotCallee. So 
your comment on "check hot callsite first" is already done.  I also don't see much point in writing

if (Callee.hasFnAttribute(Attribute::InlineHint))

  Threshold = MaxIfValid(Threshold, Params.HintThreshold);

if ( HotCallee)

  Threshold = MaxIfValid(Threshold, Params.HintThreshold);

instead of the current

if (Callee.hasFnAttribute(Attribute::InlineHint) || HotCallee)

  Threshold = MaxIfValid(Threshold, Params.HintThreshold);


https://reviews.llvm.org/D28369





More information about the llvm-commits mailing list