llvm.org GIT mirror llvm / d70d2ba
Decrease inlinecold-threshold to 45 I ran the test-suite (including SPEC 2006) in PGO mode comparing cold thresholds of 225 and 45. Here are some stats on the text size: Out of 904 tests that ran, 197 see a change in text size. The average text size reduction (of all the 904 binaries) is 1.07%. Of the 197 binaries, 19 see a text size increase, as high as 18%, but most of them are small single source benchmarks. There are 3 multisource benchmarks with a >0.5% size increase (0.7, 1.3 and 2.1 are their % increases). On the other side of the spectrum, 31 benchmarks see >10% size reduction and 6 of them are MultiSource. I haven't run the test-suite with other values of inlinecold-threshold. Since we have a cold callsite threshold of 45, I picked this value. Differential revision: https://reviews.llvm.org/D33106 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302829 91177308-0d34-0410-b5e6-96231b3b80d8 Easwaran Raman 3 years ago
2 changed file(s) with 3 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
6262 // PGO before we actually hook up inliner with analysis passes such as BPI and
6363 // BFI.
6464 static cl::opt ColdThreshold(
65 "inlinecold-threshold", cl::Hidden, cl::init(225),
65 "inlinecold-threshold", cl::Hidden, cl::init(45),
6666 cl::desc("Threshold for inlining functions with cold attribute"));
6767
6868 static cl::opt
None ; RUN: opt < %s -inline -S -inlinecold-threshold=75 | FileCheck %s
0 ; RUN: opt < %s -inline -S -inlinecold-threshold=25 | FileCheck %s
11 ; Test that functions with attribute Cold are not inlined while the
22 ; same function without attribute Cold will be inlined.
33
6363 %x3 = add i32 %x2, %a3
6464 %a4 = load volatile i32, i32* @a
6565 %x4 = add i32 %x3, %a4
66 %a5 = load volatile i32, i32* @a
67 %x5 = add i32 %x4, %a5
68 %a6 = load volatile i32, i32* @a
69 %x6 = add i32 %x5, %a6
70 %a7 = load volatile i32, i32* @a
71 %x7 = add i32 %x6, %a6
72 %a8 = load volatile i32, i32* @a
73 %x8 = add i32 %x7, %a8
74 %a9 = load volatile i32, i32* @a
75 %x9 = add i32 %x8, %a9
76 %a10 = load volatile i32, i32* @a
77 %x10 = add i32 %x9, %a10
78 %a11 = load volatile i32, i32* @a
79 %x11 = add i32 %x10, %a11
80 %a12 = load volatile i32, i32* @a
81 %x12 = add i32 %x11, %a12
82 %add = add i32 %x12, %a
66 %add = add i32 %x4, %a
8367 ret i32 %add
8468 }
8569