[Mlir-commits] [mlir] [mlir] [attribute] Fix inconsistent nested attribute parser and printer (PR #133872)

Jueon Park llvmlistbot at llvm.org
Tue Oct 14 07:48:32 PDT 2025


================
@@ -345,6 +345,27 @@ module attributes {test.someAttr = #test.cmpnd_nested_outer<i <42 <1, !test.smpl
 
 //-----
 
+// CHECK: module attributes {test.internal = #test.internal<key = 8, value = 9>} {
+// CHECK-NEXT: }
+module attributes {test.internal = #test.internal<key = 8, value = 9>} {
+}
+
+//-----
+
+// CHECK: module attributes {test.external = #test.external<internal = <key = 1, value = 2>>} {
+// CHECK-NEXT: }
+module attributes {test.external = #test.external<internal = <key = 1, value = 2>>} {
+}
+
+//-----
+
+// CHECK: module attributes {test.external_array = #test.external_array<[internals = <key = 1, value = 2>, <key = 8, value = 9>]>} {
----------------
JueonPark wrote:

The nested qualified only prints the first qualified mnemonic.

Before:
``` mlir
module attributes {test.external_array = #test.external_array<[internals = #test.internal<key = 1, value = 2>, #test.internal<key = 8, value = 9>]>} {
}
```

After:
``` mlir
module attributes {test.external_array = #test.external_array<[internals = <key = 1, value = 2>, <key = 8, value = 9>]>} {
}
```

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


More information about the Mlir-commits mailing list