<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 8, 2015 at 4:07 PM, David Li <span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davidxl added inline comments.<br>
<br>
================<br>
Comment at: llvm/trunk/lib/Analysis/InlineCost.cpp:834<br>
@@ -833,3 +833,3 @@<br>
   // out. Pretend to inline the function, with a custom threshold.<br>
<span class="">   CallAnalyzer CA(TTI, ACT, *F, InlineConstants::IndirectCallThreshold, CS);<br>
   if (CA.analyzeCall(CS)) {<br>
</span>----------------<br>
I missed this unchanged line.<br>
<br>
On second look at the patch, I think the patch is still not complete.  We should not pass a fixed Threshold for indirect callsite here -- there are other factors that can boost the inlining for the callsite once it becomes direct -- think about PGO case where the indirect callsite is super hot.<br>
<br></blockquote><div>I would also like to use the same thresholds as if we are considering inlining the resolved indirect call into CS.getCalledFunction() in the first place. In other words, inline-threshold or  inlinehint-threshold depending on whether the inline keyword is absent or present. However, this is currently done in Inliner.cpp and not inside InlineCost.cpp. So some refactoring has to be done.  </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Instead, as I said in previous comments, we should make IndirectCallThreshold as an additional booster (delta) on top of regular threshold computed.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D14309" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14309</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>