llvm-capstone/mlir/lib/Dialect/IRDL
Daniil Dudkin d4bde6968e [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
2023-08-23 17:55:10 +03:00
..
IR [mlir][irdl] Introduce a way to define regions 2023-08-23 17:55:10 +03:00
CMakeLists.txt [mlir][irdl] Add verification of IRDL ops 2023-05-17 13:34:00 +01:00
IRDLLoading.cpp [mlir][irdl] Introduce a way to define regions 2023-08-23 17:55:10 +03:00
IRDLVerifiers.cpp [mlir][irdl] Introduce a way to define regions 2023-08-23 17:55:10 +03:00