<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 22, 2016 at 2:37 PM, Easwaran Raman <span dir="ltr"><<a href="mailto:eraman@google.com" target="_blank">eraman@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">eraman added inline comments.<br>
<span class=""><br>
================<br>
Comment at: lib/Transforms/IPO/InlineSimple.cpp:138<br>
@@ +137,3 @@<br>
+  // Explicitly specified -inline-threshold overrides Threshold.<br>
+  return new SimpleInliner(DefaultInlineThreshold.getNumOccurrences() > 0<br>
+                               ? DefaultInlineThreshold<br>
----------------<br>
</span><span class="">davidxl wrote:<br>
> eraman wrote:<br>
> > davidxl wrote:<br>
> > > Why? If Threshold is explicitly passed in, should it be honored with highest precedence?<br>
> > This is the current behavior : see the code in updateThreshold. It also makes sense. If the tool user sees a flag and explicitly passes a value to it, they expect the value to take effect. Even if you disagree with this, that should be a separate change.<br>
> OK -- if this is intended as NFC. On the other hand how do you plan to handle fine grain control of different instances of the inliner ? (LTO, thinLTO, IRPGO)?<br>
</span>If we want their thresholds to be controlled by a flag, we need a separate flags and create separate entry points. For example, we should add a createPrePnliner pass that should set the threshold using a -preinline-threshold flag.<br></blockquote><div><br></div><div>It appears to me that if the creator API is used in a way that 'explicit' threshold is passed in, it is already selected via some other options which should take precedence over the generic tuning option -inline-threshold. Otherwise, the default interface or the one taking opt level should be used.  Based on this observation, I think the right behavior is not to override the passed in threshold.</div><div><br></div><div>David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="https://reviews.llvm.org/D22120" rel="noreferrer" target="_blank">https://reviews.llvm.org/D22120</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>