[Mlir-commits] [mlir] [MLIR][MLProgram] Fix crash in mlprogram-pipeline-globals on unresolvable callees (PR #189244)

Hocky Yudhiono llvmlistbot at llvm.org
Tue Mar 31 01:22:00 PDT 2026


hockyy wrote:

<img width="729" height="394" alt="image" src="https://github.com/user-attachments/assets/5d4cf25f-9d76-4586-b1c4-12f5b9b33f2f" />

This buildGlobalMap walks the module. I presume if the module is like this

module {
 
// CHECK-LABEL: @global_variable
ml_program.global private mutable @global_variable(dense<4> : tensor<4xi32>) : tensor<4xi32>

// External function declaration (no body).
func.func private @external_func() -> ()

// CHECK-LABEL: @call_external
func.func @call_external() {
  // Both loads must be preserved; the pass conservatively bails out when it
  // encounters a call to an unresolvable callee.
  // CHECK: ml_program.global_load @global_variable
  %0 = ml_program.global_load @global_variable : tensor<4xi32>
  // Call an external function with no body - pass cannot resolve callee body.
  call @external_func() : () -> ()
  // CHECK: ml_program.global_load @global_variable
  %1 = ml_program.global_load @global_variable : tensor<4xi32>
  func.return
}

func.func @internal_func() {
 .....
}

func.func @call_internal() {
   call @internal_func
}
}
```

This should be okay and not cancelling the entire pass?
<img width="729" height="394" alt="image" src="https://github.com/user-attachments/assets/dda64980-a849-4812-9905-883b5af104f1" />


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


More information about the Mlir-commits mailing list