[all-commits] [llvm/llvm-project] 0b564e: [mlir][ODS] Add a collective builder that takes th...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Mon Jan 27 23:17:03 PST 2025


  Branch: refs/heads/users/krzysz00/collective-prop-builder
  Home:   https://github.com/llvm/llvm-project
  Commit: 0b564e4c12d853d256a015050903c4cfdbcbe670
      https://github.com/llvm/llvm-project/commit/0b564e4c12d853d256a015050903c4cfdbcbe670
  Author: Krzysztof Drewniak <krzysdrewniak at gmail.com>
  Date:   2025-01-27 (Mon, 27 Jan 2025)

  Changed paths:
    M mlir/docs/DeclarativeRewrites.md
    M mlir/docs/DefiningDialects/Operations.md
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/mlir-tblgen/op-attribute.td
    M mlir/test/mlir-tblgen/op-decl-and-defs.td
    M mlir/test/mlir-tblgen/op-result.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [mlir][ODS] Add a collective builder that takes the Properties struct

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`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list