[llvm] r200898 - Set default of inlinecold-threshold to 225.

Manman Ren manman.ren at gmail.com
Wed Feb 5 17:59:23 PST 2014


Author: mren
Date: Wed Feb  5 19:59:22 2014
New Revision: 200898

URL: http://llvm.org/viewvc/llvm-project?rev=200898&view=rev
Log:
Set default of inlinecold-threshold to 225.

225 is the default value of inline-threshold. This change will make sure
we have the same inlining behavior as prior to r200886.

As Chandler points out, even though we don't have code in our testing
suite that uses cold attribute, there are larger applications that do
use cold attribute.

r200886 + this commit intend to keep the same behavior as prior to r200886.
We can later on tune the inlinecold-threshold.

The main purpose of r200886 is to help performance of instrumentation based
PGO before we actually hook up inliner with analysis passes such as BPI and BFI.
For instrumentation based PGO, we try to increase inlining of hot functions and
reduce inlining of cold functions by setting inlinecold-threshold.

Another option suggested by Chandler is to use a boolean flag that controls
if we should use OptSizeThreshold for cold functions. The default value
of the boolean flag should not change the current behavior. But it gives us
less freedom in controlling inlining of cold functions.

Modified:
    llvm/trunk/lib/Transforms/IPO/Inliner.cpp
    llvm/trunk/test/Transforms/Inline/inline-cold.ll

Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=200898&r1=200897&r2=200898&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Wed Feb  5 19:59:22 2014
@@ -50,8 +50,11 @@ static cl::opt<int>
 HintThreshold("inlinehint-threshold", cl::Hidden, cl::init(325),
               cl::desc("Threshold for inlining functions with inline hint"));
 
+// We instroduce this threshold to help performance of instrumentation based
+// PGO before we actually hook up inliner with analysis passes such as BPI and
+// BFI.
 static cl::opt<int>
-ColdThreshold("inlinecold-threshold", cl::Hidden, cl::init(75),
+ColdThreshold("inlinecold-threshold", cl::Hidden, cl::init(225),
               cl::desc("Threshold for inlining functions with cold attribute"));
 
 // Threshold to use when optsize is specified (and there is no -inline-limit).

Modified: llvm/trunk/test/Transforms/Inline/inline-cold.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/inline-cold.ll?rev=200898&r1=200897&r2=200898&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Inline/inline-cold.ll (original)
+++ llvm/trunk/test/Transforms/Inline/inline-cold.ll Wed Feb  5 19:59:22 2014
@@ -1,4 +1,4 @@
-; RUN: opt < %s -inline -S | FileCheck %s
+; RUN: opt < %s -inline -S -inlinecold-threshold=75 | FileCheck %s
 
 ; Test that functions with attribute Cold are not inlined while the 
 ; same function without attribute Cold will be inlined.





More information about the llvm-commits mailing list