[PATCH] D136774: [Outliner] Add an option to only enable outlining of patterns above a certain threshold

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 00:00:39 PDT 2023


paquette added a comment.

My main concern with this patch is that I'd actually like to avoid adding new heuristics to the outliner in general.

The main benefit of having a late outliner is to leverage accurate information about what will actually be emitted by the compiler.

> The overhead of representing a new function in the binary depends on exception metadata and alignment

Is it impossible to model this in the compiler? Or do we absolutely need a knob for this?

In general, I think it'd be best to improve the outliner cost model accuracy wherever possible, just because that is an option at this level of representation. But if it's absolutely necessary to add a heuristic, I'm not totally against it,



================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-threshold.ll:1
+; RUN: llc -verify-machineinstrs -enable-machine-outliner -aarch64-load-store-renaming=true -mtriple=aarch64-apple-darwin -outliner-benefit-threshold=60 < %s | FileCheck %s
+; RUN: llc -verify-machineinstrs -enable-machine-outliner -aarch64-load-store-renaming=true -mtriple=aarch64-apple-darwin < %s | FileCheck %s -check-prefix=ALL
----------------
this test can be removed


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-threshold.mir:1
+# RUN: llc -mtriple=aarch64--- -run-pass=prologepilog -run-pass=machine-outliner -verify-machineinstrs -frame-pointer=non-leaf %s -o - | FileCheck %s
+# RUN: llc -mtriple=aarch64--- -run-pass=prologepilog -outliner-benefit-threshold=10 -run-pass=machine-outliner -verify-machineinstrs -frame-pointer=non-leaf %s -o - | FileCheck %s -check-prefix=THRESHOLD
----------------
shouldn't need all of that in the runline


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-threshold.mir:2
+# RUN: llc -mtriple=aarch64--- -run-pass=prologepilog -run-pass=machine-outliner -verify-machineinstrs -frame-pointer=non-leaf %s -o - | FileCheck %s
+# RUN: llc -mtriple=aarch64--- -run-pass=prologepilog -outliner-benefit-threshold=10 -run-pass=machine-outliner -verify-machineinstrs -frame-pointer=non-leaf %s -o - | FileCheck %s -check-prefix=THRESHOLD
+--- |
----------------



================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-threshold.mir:5
+
+  @x = common global i32 0, align 4
+
----------------
this global is not used


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-threshold.mir:15
+
+  attributes #0 = { noinline noredzone }
+...
----------------
don't need noinline


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136774



More information about the llvm-commits mailing list