llvm-project/mlir/docs/DefiningDialects
Krzysztof Drewniak 35622a93bb
[mlir][ODS] Add a generated builder that takes the Properties struct (#124713)
This commit adds builders of the form

```
static void build(..., [TypeRange resultTypes],
                  ValueRange operands, const Properties &properties,
                  ArrayRef<NamedAttribute> discardableAttributes = {},
                  [unsigned numRegions]);
```
to go alongside the existing
result/operands/[inherent + discardable attribute list] collective
builders.

This change is intended to support a refactor to the declarative rewrite
engine to make it populate the `Properties` struct instead of creating a
`DictionaryAttr`, thus enabling rewrite rules to handle non-`Attribute`
properties.

More generally, this means that generic code that would previously call
`getAttrs()` to blend together inherent and discardable attributes can
now use `getProperties()` and `getDiscardableAttrs()` separately, thus
removing the need to serialize everything into a temporary
`DictionaryAttr`.
2025-03-05 13:17:40 -06:00
..