summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SampleProfile/inline.ll
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2015-11-24 22:38:37 +0000
committerDiego Novillo <dnovillo@google.com>2015-11-24 22:38:37 +0000
commit0b6985a3c64c255fa03daf349a5d9ea53556d6cb (patch)
tree8cecc29f6fc4f298fd10775c275374ae970c0c23 /llvm/test/Transforms/SampleProfile/inline.ll
parentf6a30d31724d0326fc2c7f64a4dd1dfd0d8d9e04 (diff)
downloadbcm5719-llvm-0b6985a3c64c255fa03daf349a5d9ea53556d6cb.tar.gz
bcm5719-llvm-0b6985a3c64c255fa03daf349a5d9ea53556d6cb.zip
SamplePGO - Add test for hot/cold inlined functions.
When the original binary is executed and sampled, the resulting profile contains information on the original inline stack. We currently follow the original inline plan if we notice that the inlined callsite has more than 0 samples to it. A better way is to determine whether the callsite is actually worth inlining. If the callsite accumulates a small fraction of the samples spent in the parent function, then we don't want to bother inlining it (as it means that the callsite is actually cold). This patch introduces a threshold expressed in percentage of samples in relation to the parent function. If the callsite uses less than N% of the total samples used by its parent, the original inline decision is not re-applied. I've set the threshold to the very arbitrary value of 5%. I'm yet to do any actual experiments to see what's a good value. I wanted to separate the basic mechanism from the tuning. llvm-svn: 254034
Diffstat (limited to 'llvm/test/Transforms/SampleProfile/inline.ll')
-rw-r--r--llvm/test/Transforms/SampleProfile/inline.ll2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/Transforms/SampleProfile/inline.ll b/llvm/test/Transforms/SampleProfile/inline.ll
index a128df56dbf..590a20f9d1d 100644
--- a/llvm/test/Transforms/SampleProfile/inline.ll
+++ b/llvm/test/Transforms/SampleProfile/inline.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.prof -S | FileCheck %s
+; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.prof -sample-profile-inline-hot-threshold=1 -S | FileCheck %s
; Original C++ test case
;
OpenPOWER on IntegriCloud