[Mlir-commits] [mlir] [mlir] Add property combinators, initial ODS support (PR #94732)
Jeff Niu
llvmlistbot at llvm.org
Tue Jul 23 07:58:13 PDT 2024
https://github.com/Mogball approved this pull request.
I mean this largely looks fine to me. I didn't do a detailed review, but I agree with the overall direction here. I also experienced a QoL downgrade when moving ops to properties because there wasn't the same level of ODS support for properties. I previously tried to add basic getters and setters for properties, but @joker-eph had concerns that it would encourage poor performance patterns.
On the other hand, since I recently made a bunch of these things generate inline in ODS, I checked the generated assembly at the time to ensure that there weren't actually any costs to doing
```C++
int a = op.getPropertyFoo();
int b = op.getPropertyBar();
```
Versus
```C++
auto &props = op.getProperties();
int a = props.foo;
int b = props.bar;
```
Assuming the return type is trivial.
General feedback here is that this seems like it could have been split up between multiple PRs: the ODS changes could have been made separately to adding all the new property combinators.
https://github.com/llvm/llvm-project/pull/94732
More information about the Mlir-commits
mailing list