[all-commits] [llvm/llvm-project] f1a040: [mlir][irdl] Add `irdl.attributes` operation for d...
Daniil Dudkin via All-commits
all-commits at lists.llvm.org
Tue Jun 20 12:35:36 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f1a040298381cdfc0657d5ecba231ebe6bbef61a
https://github.com/llvm/llvm-project/commit/f1a040298381cdfc0657d5ecba231ebe6bbef61a
Author: Daniil Dudkin <unterumarmung at yandex.ru>
Date: 2023-06-20 (Tue, 20 Jun 2023)
Changed paths:
M mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
M mlir/lib/Dialect/IRDL/IR/IRDL.cpp
M mlir/lib/Dialect/IRDL/IRDLLoading.cpp
A mlir/test/Dialect/IRDL/attributes-op.irdl.mlir
M mlir/test/Dialect/IRDL/testd.irdl.mlir
M mlir/test/Dialect/IRDL/testd.mlir
Log Message:
-----------
[mlir][irdl] Add `irdl.attributes` operation for defining named attributes
This commit introduces the `irdl.attributes` operation, which allows defining named attributes for the parent operation. Each attribute is defined with a name and a type constraint.
Example usage:
```
irdl.dialect @example {
irdl.operation @attr_op {
%0 = irdl.any
%1 = irdl.is i64
irdl.attributes {
"attr1" = %0,
"attr2" = %1
}
}
}
```
In this example the operation will expect an arbitrary attribute "attr1"
and an attribute "attr2" with value `i64`.
Reviewed By: math-fehr, Mogball
Differential Revision: https://reviews.llvm.org/D152618
More information about the All-commits
mailing list