Skip to content

Commit 24a37a3

Browse files
bolluGroverkss
authored andcommitted
[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
1 parent f3bc7fd commit 24a37a3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mlir/docs/LangRef.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ entry block cannot be listed as a successor of any other block. The syntax for a
443443
region is as follows:
444444

445445
```
446-
region ::= `{` block* `}`
446+
region ::= `{` entry-block? block* `}`
447+
entry-block ::= operation+
447448
```
448449

449450
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
454455
function arguments must match the types and count of the region arguments. In
455456
general, operations with regions can define these correspondences arbitrarily.
456457

458+
An *entry block* is a block with no label and no arguments that may occur at
459+
the beginning of a region. It enables a common pattern of using a region to
460+
open a new scope.
461+
462+
457463
### Value Scoping
458464

459465
Regions provide hierarchical encapsulation of programs: it is impossible to

0 commit comments

Comments
 (0)