mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-02 18:58:15 +00:00
d4bde6968e
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 |
||
---|---|---|
.. | ||
IR | ||
CMakeLists.txt | ||
IRDLLoading.cpp | ||
IRDLVerifiers.cpp |