[PATCH] D89085: [llvm] Update default cutoff threshold for machine function splitter.

Snehasish Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 12:51:09 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG24bf6ff4e08f: [llvm] Update default cutoff threshold for machine function splitter. (authored by snehasish).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89085/new/

https://reviews.llvm.org/D89085

Files:
  llvm/lib/CodeGen/MachineFunctionSplitter.cpp
  llvm/test/CodeGen/X86/machine-function-splitter.ll


Index: llvm/test/CodeGen/X86/machine-function-splitter.ll
===================================================================
--- llvm/test/CodeGen/X86/machine-function-splitter.ll
+++ llvm/test/CodeGen/X86/machine-function-splitter.ll
@@ -1,5 +1,5 @@
 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions | FileCheck %s -check-prefix=MFS-DEFAULTS
-; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions -mfs-count-threshold=2000 | FileCheck %s --dump-input=always -check-prefix=MFS-OPTS1
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions -mfs-psi-cutoff=0 -mfs-count-threshold=2000 | FileCheck %s --dump-input=always -check-prefix=MFS-OPTS1
 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions -mfs-psi-cutoff=950000 | FileCheck %s -check-prefix=MFS-OPTS2
 
 define void @foo1(i1 zeroext %0) nounwind !prof !14 !section_prefix !15 {
Index: llvm/lib/CodeGen/MachineFunctionSplitter.cpp
===================================================================
--- llvm/lib/CodeGen/MachineFunctionSplitter.cpp
+++ 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",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89085.298225.patch
Type: text/x-patch
Size: 2072 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201014/f7932e43/attachment.bin>


More information about the llvm-commits mailing list