[Mlir-commits] [mlir] [MLIR][LivenessAnalysis] Treat a public function as an external (PR #160648)
Mehdi Amini
llvmlistbot at llvm.org
Fri Sep 26 05:40:58 PDT 2025
================
@@ -569,6 +569,23 @@ module @return_void_with_unused_argument {
call @fn_return_void_with_unused_argument(%arg0, %unused) : (i32, memref<4xi32>) -> ()
return %unused : memref<4xi32>
}
+ // the function is immutable because it is public.
+ func.func public @immutable_fn_return_void_with_unused_argument(%arg0: i32, %unused: i32) -> () {
+ %sum = arith.addi %arg0, %arg0 : i32
+ %c0 = arith.constant 0 : index
+ %buf = memref.alloc() : memref<1xi32>
+ memref.store %sum, %buf[%c0] : memref<1xi32>
----------------
joker-eph wrote:
Why all this? Can we do it minimally?
```
func.func public @public_func_with_unused_argument(%unused: i32) -> () {
return
}
```
https://github.com/llvm/llvm-project/pull/160648
More information about the Mlir-commits
mailing list