[PATCH] D22120: Move inline threshold related flags to InlineSimple.cpp

Easwaran Raman via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 14:37:17 PDT 2016


eraman added inline comments.

================
Comment at: lib/Transforms/IPO/InlineSimple.cpp:138
@@ +137,3 @@
+  // Explicitly specified -inline-threshold overrides Threshold.
+  return new SimpleInliner(DefaultInlineThreshold.getNumOccurrences() > 0
+                               ? DefaultInlineThreshold
----------------
davidxl wrote:
> eraman wrote:
> > davidxl wrote:
> > > Why? If Threshold is explicitly passed in, should it be honored with highest precedence?
> > 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.
> 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)?
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. 


https://reviews.llvm.org/D22120





More information about the llvm-commits mailing list