Use properties for attributes for many dialects #7736
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change enables the use of operation properties for more dialects in CIRCT. The option to not use properties is going to be removed in a future release of MLIR, but as well we expect this change to bring a performance improvement.
For all these dialects, the only change required was to properly infer return types. Some operations were hardcoded to search through the attributes, and the attribute was moved to the property storage. By using the generated adaptor classes, we can abstract over where the interesting attribute is stored.
For future work, some code may be refactored for further performance wins now that we are using properties. In particular usages
setAttr
andgetAttr
may be made faster by using a less generic op transformation interface.