Properties in core dialects

I have a question about properties in MLIR. I’m not sure how to tell whether an operation in the included dialects actually uses properties vs attributes. If we take the memref.global operation as an example, the website specifies that it has a number of attributes. The MemRefOps.td file specifies the arguments like this:

  let arguments = (ins SymbolNameAttr:$sym_name,
                       OptionalAttr<StrAttr>:$sym_visibility,
                       MemRefTypeAttr:$type,
                       OptionalAttr<AnyAttr>:$initial_value,
                       UnitAttr:$constant,
                       OptionalAttr<I64Attr>:$alignment);

But when I print the mlir using --mlir-print-op-generics it’s printing it all in a <{}> dictionary. Where in the definition of the operation can I tell that it’s using properties?

Whether inherent attributes are part of the properties dictionary or the dictionary attribute depends on the value of usePropertiesForAttributes of the dialect that the operation is part of.
I believe the current direction is that all all inherent attributes are being switched (or have already switched in-tree I think) to using properties and that using the dictionary attribute for inherent attributes will be removed in the future.

Thank you.

For future reference, for memref, that value is set in MemRefBase.td

There isn’t a single dialect that I know of in-tree that wouldn’t use properties by now, also it’s the default so we can remove the opt-in statement in the dialect definitions.

Good to know. It might be worth updating the documentation on the website to say “Properties” instead of “Attributes” to minimise confusion.

Technically we still store “inherent attributes” inside the Properties storage.
Properties can also be native (not attributes) but we (almost) don’t have any in use right now (one exception can be the operand_segment_sizes which is no longer stored as an attribute).