[Mlir-commits] [mlir] Enable printing newlines and indents in attribute and type printers (PR #87948)

Lukasz Mielicki llvmlistbot at llvm.org
Thu Sep 4 03:03:22 PDT 2025


lmielick wrote:

I understand the concern and how restricting the newline support to aliases encourages terse IR design.
However I will argue there are cases where deep nesting of attributes is actually desired and increases readability. I find nested representation important in low level dialects for hardware where complex multi-level operation descriptors are commonplace. At that level IR structure becomes trivial but the operations become complex with dozens or hundreds of settings in them.
Use of aliases puts pieces of a single operation out of line, which breaks the locality of reasoning and does not address such use-case.

Perhaps we could allow the flexibility for attribute printers but instead of explicit restriction provide more guidance for IR design, but I would rather defer such decisions to specific dialects and I'm positive reviewers would spot this kind of issues if printers become too elaborate.

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


More information about the Mlir-commits mailing list