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

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 17:51:22 PDT 2020


Arguably since this is going to be very cpu dependent perhaps it should be
part of TTI?

-eric

On Thu, Oct 8, 2020 at 8:47 PM Snehasish Kumar via Phabricator <
reviews at reviews.llvm.org> wrote:

> snehasish created this revision.
> snehasish added a reviewer: tmsriram.
> Herald added subscribers: llvm-commits, hiraditya.
> Herald added a project: LLVM.
> snehasish requested review of this revision.
>
> 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 <
> https://reviews.llvm.org/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 |
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> 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
> @@ -43,7 +43,7 @@
>      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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201008/aa427456/attachment.html>


More information about the llvm-commits mailing list