[Mlir-commits] [mlir] [MLIR][LivenessAnalysis] Treat a public function as an external (PR #160648)

xin liu llvmlistbot at llvm.org
Wed Oct 1 08:47:39 PDT 2025


navyxliu wrote:

> hi, @joker-eph We come up yet another idea. How about we clone the public function foo() and mark the clone private?
> 
> ```
> public void foo(%unused: i32) {
> return; 
> }
> bar() {
> %x = ...
> foo(%x)
> }
> => clone change its uses:
> public void foo(%unused: i32) {
> return; 
> }
> private void foo_(%unused: i32) {
> return; 
> }
> bar() {
> %x = ...
> foo_(%x)
> }
> ```
> 
> then everything is in order.

I tried this idea. it has one limitation. 
we can clone a function, but we can't clone liveness results from the old function to the new. 
The dataflow framework doesn't support incremental solver. 

If we want to go this route, we need to pre-process call Ops and clone them prior to 'RunLivenessAnalysis'.

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


More information about the Mlir-commits mailing list