forked from OSchip/llvm-project
[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:
parent
f3bc7fd546
commit
24a37a396a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue