<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 6, 2017 at 3:37 PM, Easwaran Raman via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">eraman added a comment.<br>
<span class=""><br>
In <a href="https://reviews.llvm.org/D28369#638393" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D28369#638393</a>, @davidxl wrote:<br>
<br>
> Should we honor optForMinSize for HotCallsite case as well?<br>
<br>
<br>
</span>Yes, unless and until someone tunes PGO + -Os case.<br>
<span class=""><br>
> I also suggest split the source hint based check from the profile driven check.  Also check hotcallsite first:<br>
><br>
> if (!Caller->optForMinSize() ) {<br>
><br>
>   if (...InlineHint)<br>
>     Threshold = MaxIfValid (...);<br>
><br>
>   if (HotCallsite)<br>
>      ...<br>
>   else if (HotCallee)<br>
>     ..<br>
><br>
> }<br>
<br>
</span>Note that HotCallsite and HotCallee are mutually exclusive and if the callsite is hot that takes precedence over HotCallee. So<br>
your comment on "check hot callsite first" is already done. </blockquote><div><br></div><div><br></div><div>yes -- but the way it is written it is a little subtle. I think it is better to make the precedence explicit.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> I also don't see much point in writing<br>
<br>
if (Callee.hasFnAttribute(<wbr>Attribute::InlineHint))<br>
<br>
  Threshold = MaxIfValid(Threshold, Params.HintThreshold);<br>
<br>
if ( HotCallee)<br>
<br>
  Threshold = MaxIfValid(Threshold, Params.HintThreshold);<br>
<br>
instead of the current<br>
<br>
if (Callee.hasFnAttribute(<wbr>Attribute::InlineHint) || HotCallee)<br>
<br>
  Threshold = MaxIfValid(Threshold, Params.HintThreshold);<br>
<br></blockquote><div><br></div><div>It is fine as it is, but I think the suggested way does allow us to split HotCallee with a different threshold parameter in the future if needed. Tie it with InlineHint does not sound the right thing longer term.</div><div><br></div><div>David</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<a href="https://reviews.llvm.org/D28369" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D28369</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>