[Mlir-commits] [mlir] [mlir][IR] Add `getPropertyAsAttr` and `setPropertyFromAttr` methods. (PR #150060)
Krzysztof Drewniak
llvmlistbot at llvm.org
Tue Jul 29 15:58:23 PDT 2025
krzysz00 wrote:
I'm fundamentally fine with a duplicated structure between attributes and non-attribute fields of a `Properties` struct - they serve different and related purposes. For instance, the argument to `arith.constant` should likely always be an `Attribute`, because it's allowed and often expected to be a big value that shouldn't be inlined. Attributes also provide a certain amount of generic processing ability that's hard to get out of the C++ type system (we don't have `Object object;` around here)
I don't understand what end model you're going for here. I think the current system is quite workable, with the caveat that a bunch of infrastructure is missing (ex., parsers should be doing the switch-case into the properties struct, Python bindings, etc.) and that we've got a whole bunch of stuff leaning on getAttrDictionary() and other APIs that aren't making a careful inherent/discardable distinction.
https://github.com/llvm/llvm-project/pull/150060
More information about the Mlir-commits
mailing list