commit | c0c1e3e288efa35c427b2a5aab3f8566b6f98b8d | [log] [tgz] |
---|---|---|
author | Markus Böck <markus.boeck02@gmail.com> | Mon Apr 15 12:13:06 2024 +0200 |
committer | Copybara-Service <copybara-worker@google.com> | Mon Apr 15 03:32:31 2024 -0700 |
tree | 8a257b7c879a9a85ab156c6e95efa08e2b233343 | |
parent | 61721fd94d3eca8de3268b4c48a9a1e2a5137048 [diff] |
[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 GitOrigin-RevId: 5b95c9e0cad189cc609c31029f6bc3a89bc7b612
See https://mlir.llvm.org/ for more information.