[Mlir-commits] [mlir] 24a37a3 - [MLIR] add entry block to MLIR grammar.
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Feb 17 02:11:12 PST 2022
Author: Siddharth Bhat
Date: 2022-02-17T15:40:43+05:30
New Revision: 24a37a396a9bd6b73b05b4eafce8b87e7a748cf9
URL: https://github.com/llvm/llvm-project/commit/24a37a396a9bd6b73b05b4eafce8b87e7a748cf9
DIFF: https://github.com/llvm/llvm-project/commit/24a37a396a9bd6b73b05b4eafce8b87e7a748cf9.diff
LOG: [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
Added:
Modified:
mlir/docs/LangRef.md
Removed:
################################################################################
diff --git a/mlir/docs/LangRef.md b/mlir/docs/LangRef.md
index 92a5413a656d8..2fe1c6248c8a4 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
More information about the Mlir-commits
mailing list