diff options
author | Daniil Dudkin <unterumarmung@yandex.ru> | 2023-08-23 17:33:52 +0300 |
---|---|---|
committer | Daniil Dudkin <unterumarmung@yandex.ru> | 2023-08-23 17:55:10 +0300 |
commit | d4bde6968e11a6b8ff9ecd5fbca1d98d8f6feeca (patch) | |
tree | 55f09f89689732e892337fd1aba8a76cd881799d /clang/lib/CodeGen/CodeGenFunction.h | |
parent | 102970091ef074dfdb998eb9a25f742e8ad74ddc (diff) | |
download | llvm-d4bde6968e11a6b8ff9ecd5fbca1d98d8f6feeca.zip llvm-d4bde6968e11a6b8ff9ecd5fbca1d98d8f6feeca.tar.gz llvm-d4bde6968e11a6b8ff9ecd5fbca1d98d8f6feeca.tar.bz2 |
[mlir][irdl] Introduce a way to define regions
This patch introduces new operations:
`irdl.region` and `irdl.regions`.
The former lets us to specify characteristics of a region,
such as the arguments for the entry block and the number of blocks.
The latter accepts all results of the former operations
to define the set of the regions for the operation.
Example:
```
irdl.dialect @example {
irdl.operation @op_with_regions {
%r0 = irdl.region
%r1 = irdl.region()
%v0 = irdl.is i32
%v1 = irdl.is i64
%r2 = irdl.region(%v0, %v1)
%r3 = irdl.region with size 3
irdl.regions(%r0, %r1, %r2, %r3)
}
}
```
The above snippet demonstrates an operation named `@op_with_regions`,
which is constrained to have four regions.
* Region `%r0` doesn't have any constraints on the arguments or the number of blocks.
* Region `%r1` should have an empty set of arguments.
* Region `%r2` should have two arguments of types `i32` and `i64`.
* Region `%r3` should contain exactly three blocks.
In the future the block count constraint may be expanded to support range of possible number of blocks.
Reviewed By: math-fehr, Mogball
Differential Revision: https://reviews.llvm.org/D155112
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
0 files changed, 0 insertions, 0 deletions