[Mlir-commits] [mlir] [mlir] Walk nested non-symbol table ops in symbol dce (PR #143353)

Mehdi Amini llvmlistbot at llvm.org
Tue Jun 24 06:14:48 PDT 2025


================
@@ -98,3 +98,24 @@ module {
   // CHECK: "live.user"() {uses = [@unknown_symbol]} : () -> ()
   "live.user"() {uses = [@unknown_symbol]} : () -> ()
 }
+
+// -----
+
+// Check that we don't DCE nested symbols if they are nested inside region
+// without SymbolTable.
+// CHECK-LABEL: module attributes {test.nested_nosymboltable_region}
+module attributes {test.nested_nosymboltable_region} {
+  "test.one_region_op"() ({
+    module {
+        func.func nested @nested() {
+            return
+        }
+
+        func.func @main() {
+            return
+        }
+    }
+    "test.finish"() : () -> ()
+  }) : () -> ()
+}
----------------
joker-eph wrote:

This test should have:
```
// CHECK-NOT: @nested
// CHECK: @main
```

But we also need your original test that was checking that we wouldn't delete @nested when called. Right now the comment does not match the test.

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


More information about the Mlir-commits mailing list