[Mlir-commits] [mlir] [mlir] Remove extra whitespace during printout in prop-dict (#145695) (PR #145908)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Jun 26 10:48:10 PDT 2025
weirdsmiley wrote:
1. For the "consistency" part, the issue raised [here](https://github.com/llvm/llvm-project/issues/145695) has been that under cases where there is one attribute with `elidedProps`, then printer puts a whitespace, while if there are more than one attributes then it won't. For example, [this test](https://github.com/llvm/llvm-project/blob/7842e9eada2e7b6bdb68aa4add5d29bce242e20a/mlir/test/mlir-tblgen/op-format.mlir#L293-L299) shows both cases which are different during printing.
```
// CHECK: test.format_optional_prop_dict < {a = ["foo"]}>
// ^ extra whitespace
test.format_optional_prop_dict <{a = ["foo"]}>
// CHECK: test.format_optional_prop_dict < {b = 2 : i32}>
// ^ extra whitespace
test.format_optional_prop_dict <{b = 2 : i32}>
// CHECK: test.format_optional_prop_dict <{a = ["foo"], b = 2 : i32}>
// ^ no whitespace
```
2. We can add option `bool addSpacePrefix = true`. But if user sets it to `false` then do we expect to put no whitespaces in prefix? That would result in above said situations like `module attributes{`.
https://github.com/llvm/llvm-project/pull/145908
More information about the Mlir-commits
mailing list