[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
This commit is contained in:
Siddharth Bhat 2022-02-17 15:40:19 +05:30 committed by Groverkss
parent f3bc7fd546
commit 24a37a396a
1 changed files with 7 additions and 1 deletions

View File

@ -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