diff options
author | Siddharth Bhat <siddu.druid@gmail.com> | 2022-02-17 15:40:19 +0530 |
---|---|---|
committer | Groverkss <groverkss@gmail.com> | 2022-02-17 15:40:43 +0530 |
commit | 24a37a396a9bd6b73b05b4eafce8b87e7a748cf9 (patch) | |
tree | 6cf599933b2c86b387141a2d4bcaf78eb09601bd | |
parent | f3bc7fd5465a3a919388b6a0307553ef4a6d39c9 (diff) | |
download | llvm-24a37a396a9bd6b73b05b4eafce8b87e7a748cf9.zip llvm-24a37a396a9bd6b73b05b4eafce8b87e7a748cf9.tar.gz llvm-24a37a396a9bd6b73b05b4eafce8b87e7a748cf9.tar.bz2 |
[MLIR] add entry block to MLIR grammar.
The MLIR parser allows regions to have an unnamed entry block.
Make this explicit in the language grammar.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D119950
-rw-r--r-- | mlir/docs/LangRef.md | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mlir/docs/LangRef.md b/mlir/docs/LangRef.md index 92a5413..2fe1c62 100644 --- a/mlir/docs/LangRef.md +++ b/mlir/docs/LangRef.md @@ -443,7 +443,8 @@ entry block cannot be listed as a successor of any other block. The syntax for a region is as follows: ``` -region ::= `{` block* `}` +region ::= `{` entry-block? block* `}` +entry-block ::= operation+ ``` A function body is an example of a region: it consists of a CFG of blocks and @@ -454,6 +455,11 @@ arguments must match the result types of the function signature. Similarly, the function arguments must match the types and count of the region arguments. In general, operations with regions can define these correspondences arbitrarily. +An *entry block* is a block with no label and no arguments that may occur at +the beginning of a region. It enables a common pattern of using a region to +open a new scope. + + ### Value Scoping Regions provide hierarchical encapsulation of programs: it is impossible to |