aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunctionSplitter.cpp
diff options
context:
space:
mode:
authorSnehasish Kumar <snehasishk@google.com>2020-10-08 17:36:13 -0700
committerSnehasish Kumar <snehasishk@google.com>2020-10-14 12:48:10 -0700
commit24bf6ff4e08f88df0b6c01ef87aa384276636901 (patch)
tree90a46f07f9ca0a2487455848a796b16b16c06040 /llvm/lib/CodeGen/MachineFunctionSplitter.cpp
parentdd378739d731c81ded5209d70e2313c24811434d (diff)
downloadllvm-24bf6ff4e08f88df0b6c01ef87aa384276636901.zip
llvm-24bf6ff4e08f88df0b6c01ef87aa384276636901.tar.gz
llvm-24bf6ff4e08f88df0b6c01ef87aa384276636901.tar.bz2
[llvm] Update default cutoff threshold for machine function splitter.
Based on internal testing at Google we found that setting the profile summary cutoff threshold to 999950 yields the best results in terms of itlb and icache metrics (as observed on Intel CPUs). *default* = Split out code if no profile count available for block *size-%* = The fraction of bytes split out of .text and .text.hot *itlb* = Misses per kilo instructions (MPKI) for itlb *icache* = Misses per kilo instructions (MPKI) for L1 icache Search1 | cutoff | size-% | itlb | icache | |---------|---------|-----------|---------| | default | 42.5861 | 0.0822151 | 2.46363 | | 999999 | 44.9350 | 0.0767194 | 2.44416 | | 999950 | 50.0660 | 0.075744 | 2.4091 | | 999500 | 56.9158 | 0.082564 | 2.4188 | | 995000 | 63.8625 | 0.0814927 | 2.42832 | | 990000 | 71.7314 | 0.106906 | 2.57785 | Search2 | cutoff | size-% | itlb | icache | |---------|--------|----------|---------| | default | 2.8845 | 0.626712 | 4.73245 | | 999999 | 3.3291 | 0.602309 | 4.70045 | | 999950 | 3.8577 | 0.587842 | 4.71632 | | 999500 | 4.4170 | 0.63577 | 4.68351 | | 995000 | 5.1020 | 0.657969 | 4.82272 | | 990000 | 5.7153 | 0.719122 | 5.39496 | Differential Revision: https://reviews.llvm.org/D89085
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunctionSplitter.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunctionSplitter.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineFunctionSplitter.cpp b/llvm/lib/CodeGen/MachineFunctionSplitter.cpp
index 1a1bd901..b2f474a 100644
--- a/llvm/lib/CodeGen/MachineFunctionSplitter.cpp
+++ b/llvm/lib/CodeGen/MachineFunctionSplitter.cpp
@@ -39,11 +39,18 @@
using namespace llvm;
+// FIXME: This cutoff value is CPU dependent and should be moved to
+// TargetTransformInfo once we consider enabling this on other platforms.
+// The value is expressed as a ProfileSummaryInfo integer percentile cutoff.
+// Defaults to 999950, i.e. all blocks colder than 99.995 percentile are split.
+// The default was empirically determined to be optimal when considering cutoff
+// values between 99%-ile to 100%-ile with respect to iTLB and icache metrics on
+// Intel CPUs.
static cl::opt<unsigned>
PercentileCutoff("mfs-psi-cutoff",
cl::desc("Percentile profile summary cutoff used to "
"determine cold blocks. Unused if set to zero."),
- cl::init(0), cl::Hidden);
+ cl::init(999950), cl::Hidden);
static cl::opt<unsigned> ColdCountThreshold(
"mfs-count-threshold",