[Mlir-commits] [mlir] [mlir][gpu] Fix null-deref crash in gpu-kernel-outlining for unresolved symbols (PR #186273)

Mehdi Amini llvmlistbot at llvm.org
Fri Mar 13 04:00:04 PDT 2026


================
@@ -638,6 +638,31 @@ func.func @testNoAttributes() {
 
 // -----
 
+// Regression test for https://github.com/llvm/llvm-project/issues/185357.
+// A gpu.launch whose body contains a gpu.launch_func referencing a symbol in a
+// nested gpu.module must not crash when the leaf reference cannot be found in
+// the parent symbol table.
+
+// CHECK-LABEL: func.func @launch_with_launch_func_body(
+module attributes {gpu.container_module} {
+  gpu.module @some_kernels {
+    gpu.func @some_kernel() kernel {
+      gpu.return
+    }
+  }
+  func.func @launch_with_launch_func_body(%sz : index) {
+    gpu.launch blocks(%bx, %by, %bz) in (%gx = %sz, %gy = %sz, %gz = %sz)
+               threads(%tx, %ty, %tz) in (%bsx = %sz, %bsy = %sz, %bsz = %sz) {
+      gpu.launch_func @some_kernels::@some_kernel
+          blocks in (%bx, %by, %bz) threads in (%tx, %ty, %tz)
----------------
joker-eph wrote:

Good point about the doc being stale. Note that right below this test is another one with nested gpu.launch

For now I remove the nested launch_func from this test: it isn't needed here, I just needed a nested ref.



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


More information about the Mlir-commits mailing list