[Mlir-commits] [mlir] [RFC][mlir] Add profitability callback to the Inliner. (PR #84258)

Mehdi Amini llvmlistbot at llvm.org
Tue Mar 12 15:59:57 PDT 2024


================
@@ -0,0 +1,19 @@
+// RUN: mlir-opt %s --mlir-disable-threading -inline='default-pipeline='' inlining-threshold=100' -debug-only=inliner-pass 2>&1 | FileCheck %s
+
+// Check that inlining does not happen when the threshold is exceeded.
+func.func @callee1(%arg : i32) -> i32 {
+  %v1 = arith.addi %arg, %arg : i32
+  %v2 = arith.addi %v1, %arg : i32
+  %v3 = arith.addi %v2, %arg : i32
+  return %v3 : i32
+}
+
+// CHECK: Callee / caller operation ratio (max: 100): 200
----------------
joker-eph wrote:

We don't test debug output, just remove this check and everything looks good otherwise.

https://github.com/llvm/llvm-project/pull/84258


More information about the Mlir-commits mailing list