[Mlir-commits] [mlir] [mlir][func] Add eliminate-function-parameter pass (PR #160654)
Mehdi Amini
llvmlistbot at llvm.org
Thu Sep 25 03:11:41 PDT 2025
================
@@ -0,0 +1,32 @@
+// RUN: mlir-opt %s --split-input-file --eliminate-function-parameter | \
+// RUN: FileCheck %s
+
+func.func @single_parameter(%arg: index) {
+ return
+}
+
+func.func @mutl_parameter(%arg0 : index, %arg1 : index) -> index {
+ return %arg0 : index
+}
+
+func.func @eliminate_parameter(%arg0: index, %arg1: index) -> index {
+ func.call @single_parameter(%arg0) : (index) -> ()
+ %ret = func.call @mutl_parameter(%arg0, %arg0) : (index, index) -> (index)
+ return %ret : index
+}
----------------
joker-eph wrote:
Note: all these functions are public, it is incorrect to change the signature of a public function: you can't know about call sites outside of the current module.
https://github.com/llvm/llvm-project/pull/160654
More information about the Mlir-commits
mailing list