[mlir][ODS] Make `prop-dict` behave closer to `attr-dict` (#88659)
`attr-dict` currently prints any attribute (inherent or discardable) that does not occur elsewhere in the assembly format. `prop-dict` on the other hand, always prints and parses all properties (including inherent attributes stored as properties) as part of the property dictionary, regardless of whether the properties or attributes are used elsewhere. (with the exception of default-valued attributes implemented recently in https://github.com/llvm/llvm-project/pull/87970). This PR changes the behavior of `prop-dict` to only print and parse attributes and properties that do not occur elsewhere in the assembly format. This is achieved by 1) adding used attributes and properties to the elision list when printing and 2) using a custom version of `setPropertiesFromAttr` called `setPropertiesFromParsedAttr` that is sensitive to the assembly format and auto-generated by ODS. The current and new behavior of `prop-dict` and `attr-dict` were also documented. Happens to also fix https://github.com/llvm/llvm-project/issues/88506
parent
33e60f35
Please register or sign in to comment