[Mlir-commits] [mlir] [mlir][AsmPrinter] Print op properties directly in generic form (PR #106996)
River Riddle
llvmlistbot at llvm.org
Mon Sep 2 12:01:17 PDT 2024
River707 wrote:
> > I think if we just go with "default-created properties should be printable" invariant, this would give us the guarantees we want without needing to invent attributes for properties.
>
> Why is « default constructed » important here?
>
> Also, back to the invariant of the generic format: « we can parse it back without registering the op » has been what we preserved so far. I am a bit nervous about breaking this.
Yes, I completely agree here. We should not under any circumstance break the ability to parse generic IR when dialects aren't registered. One thing that has been in mind though, why not change properties to just preserve the string form the same way we do for UnknownAttr/UnknownType when the op isn't registered? I don't think there is a strict requirement that we must parse/print as attributes in the generic form, and preserving the string in the unknown case would allow for more optimal roundtripability (I would love to kill the property<->attribute conversion stuff).
https://github.com/llvm/llvm-project/pull/106996
More information about the Mlir-commits
mailing list