summaryrefslogtreecommitdiffstats
path: root/mlir/docs
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/docs')
-rw-r--r--mlir/docs/Dialects/Affine.md34
-rw-r--r--mlir/docs/Dialects/Standard.md16
-rw-r--r--mlir/docs/LangRef.md22
3 files changed, 36 insertions, 36 deletions
diff --git a/mlir/docs/Dialects/Affine.md b/mlir/docs/Dialects/Affine.md
index c5dcf6a6790..245ba33fed6 100644
--- a/mlir/docs/Dialects/Affine.md
+++ b/mlir/docs/Dialects/Affine.md
@@ -22,7 +22,7 @@ Examples:
```mlir
// A 2d to 3d affine mapping.
// d0/d1 are dimensions, s0 is a symbol
-#affine_map2to3 = (d0, d1)[s0] -> (d0, d1 + s0, d1 - s0)
+#affine_map2to3 = affine_map<(d0, d1)[s0] -> (d0, d1 + s0, d1 - s0)>
```
Dimensional identifiers correspond to the dimensions of the underlying structure
@@ -52,7 +52,7 @@ SSA values bound to dimensions and symbols must always have 'index' type.
Example:
```mlir
-#affine_map2to3 = (d0, d1)[s0] -> (d0, d1 + s0, d1 - s0)
+#affine_map2to3 = affine_map<(d0, d1)[s0] -> (d0, d1 + s0, d1 - s0)>
// Binds %N to the s0 symbol in affine_map2to3.
%x = alloc()[%N] : memref<40x50xf32, #affine_map2to3>
```
@@ -177,14 +177,14 @@ Examples:
```mlir
// Affine map out-of-line definition and usage example.
-#affine_map42 = (d0, d1)[s0] -> (d0, d0 + d1 + s0 floordiv 2)
+#affine_map42 = affine_map<(d0, d1)[s0] -> (d0, d0 + d1 + s0 floordiv 2)>
// Use an affine mapping definition in an alloc operation, binding the
// SSA value %N to the symbol s0.
%a = alloc()[%N] : memref<4x4xf32, #affine_map42>
// Same thing with an inline affine mapping definition.
-%b = alloc()[%N] : memref<4x4xf32, (d0, d1)[s0] -> (d0, d0 + d1 + s0 floordiv 2)>
+%b = alloc()[%N] : memref<4x4xf32, affine_map<(d0, d1)[s0] -> (d0, d0 + d1 + s0 floordiv 2)>>
```
### Semi-affine maps
@@ -280,8 +280,8 @@ Example:
```mlir
// A example two-dimensional integer set with two symbols.
-#set42 = (d0, d1)[s0, s1]
- : (d0 >= 0, -d0 + s0 - 1 >= 0, d1 >= 0, -d1 + s1 - 1 >= 0)
+#set42 = affine_set<(d0, d1)[s0, s1]
+ : (d0 >= 0, -d0 + s0 - 1 >= 0, d1 >= 0, -d1 + s1 - 1 >= 0)>
// Inside a Region
affine.if #set42(%i, %j)[%M, %N] {
@@ -299,7 +299,7 @@ affine.if #set42(%i, %j)[%M, %N] {
Syntax:
```
-operation ::= ssa-id `=` `affine.apply` affine-map dim-and-symbol-use-list
+operation ::= ssa-id `=` `affine.apply` affine-map-attribute dim-and-symbol-use-list
```
The `affine.apply` operation applies an
@@ -312,12 +312,12 @@ value. The input operands and result must all have 'index' type.
Example:
```mlir
-#map10 = (d0, d1) -> (d0 floordiv 8 + d1 floordiv 128)
+#map10 = affine_map<(d0, d1) -> (d0 floordiv 8 + d1 floordiv 128)>
...
%1 = affine.apply #map10 (%s, %t)
// Inline example.
-%2 = affine.apply (i)[s0] -> (i+s0) (%42)[%n]
+%2 = affine.apply affine_map<(i)[s0] -> (i+s0)> (%42)[%n]
```
#### 'affine.for' operation
@@ -328,8 +328,8 @@ Syntax:
operation ::= `affine.for` ssa-id `=` lower-bound `to` upper-bound
(`step` integer-literal)? `{` op* `}`
-lower-bound ::= `max`? affine-map dim-and-symbol-use-list | shorthand-bound
-upper-bound ::= `min`? affine-map dim-and-symbol-use-list | shorthand-bound
+lower-bound ::= `max`? affine-map-attribute dim-and-symbol-use-list | shorthand-bound
+upper-bound ::= `min`? affine-map-attribute dim-and-symbol-use-list | shorthand-bound
shorthand-bound ::= ssa-id | `-`? integer-literal
```
@@ -366,7 +366,7 @@ nullary mapping function that returns the constant value (e.g. `()->(-42)()`).
Example showing reverse iteration of the inner loop:
```mlir
-#map57 = (d0)[s0] -> (s0 - d0 - 1)
+#map57 = affine_map<(d0)[s0] -> (s0 - d0 - 1)>
func @simple_example(%A: memref<?x?xf32>, %B: memref<?x?xf32>) {
%N = dim %A, 0 : memref<?x?xf32>
@@ -387,7 +387,7 @@ Syntax:
```
operation ::= `affine.if` if-op-cond `{` op* `}` (`else` `{` op* `}`)?
-if-op-cond ::= integer-set dim-and-symbol-use-list
+if-op-cond ::= integer-set-attr dim-and-symbol-use-list
```
The `affine.if` operation restricts execution to a subset of the loop iteration
@@ -410,8 +410,8 @@ blocks must not have any arguments.
Example:
```mlir
-#set = (d0, d1)[s0]: (d0 - 10 >= 0, s0 - d0 - 9 >= 0,
- d1 - 10 >= 0, s0 - d1 - 9 >= 0)
+#set = affine_set<(d0, d1)[s0]: (d0 - 10 >= 0, s0 - d0 - 9 >= 0,
+ d1 - 10 >= 0, s0 - d1 - 9 >= 0)>
func @reduced_domain_example(%A, %X, %N) : (memref<10xi32>, i32, i32) {
affine.for %i = 0 to %N {
affine.for %j = 0 to %N {
@@ -571,7 +571,7 @@ Example:
Syntax:
```
-operation ::= ssa-id `=` `affine.min` affine-map dim-and-symbol-use-list
+operation ::= ssa-id `=` `affine.min` affine-map-attribute dim-and-symbol-use-list
```
The `affine.min` operation applies an
@@ -585,7 +585,7 @@ Example:
```mlir
-%0 = affine.min (d0)[s0] -> (1000, d0 + 512, s0) (%arg0)[%arg1]
+%0 = affine.min affine_map<(d0)[s0] -> (1000, d0 + 512, s0)> (%arg0)[%arg1]
```
diff --git a/mlir/docs/Dialects/Standard.md b/mlir/docs/Dialects/Standard.md
index f84a2c94e92..0d30296b4c2 100644
--- a/mlir/docs/Dialects/Standard.md
+++ b/mlir/docs/Dialects/Standard.md
@@ -259,12 +259,12 @@ Example:
```mlir
%size = constant 32 : index
-%tag = alloc() : memref<1 x i32, (d0) -> (d0), 4>
+%tag = alloc() : memref<1 x i32, affine_map<(d0) -> (d0)>, 4>
%idx = constant 0 : index
dma_start %src[%i, %j], %dst[%k, %l], %size, %tag[%idx] :
- memref<40 x 8 x vector<16xf32>, (d0, d1) -> (d0, d1), 0>,
- memref<2 x 4 x vector<16xf32>, (d0, d1) -> (d0, d1), 2>,
- memref<1 x i32>, (d0) -> (d0), 4>
+ memref<40 x 8 x vector<16xf32>, affine_map<(d0, d1) -> (d0, d1)>, 0>,
+ memref<2 x 4 x vector<16xf32>, affine_map<(d0, d1) -> (d0, d1)>, 2>,
+ memref<1 x i32>, affine_map<(d0) -> (d0)>, 4>
```
### 'dma_wait' operation
@@ -284,7 +284,7 @@ load/store indices.
Example:
```mlir
-dma_wait %tag[%idx], %size : memref<1 x i32, (d0) -> (d0), 4>
+dma_wait %tag[%idx], %size : memref<1 x i32, affine_map<(d0) -> (d0)>, 4>
```
### 'extract_element' operation
@@ -334,12 +334,12 @@ values or the recursively result of such an `affine.apply` operation.
Example:
```mlir
-%1 = affine.apply (d0, d1) -> (3*d0) (%i, %j)
-%2 = affine.apply (d0, d1) -> (d1+1) (%i, %j)
+%1 = affine.apply affine_map<(d0, d1) -> (3*d0)> (%i, %j)
+%2 = affine.apply affine_map<(d0, d1) -> (d1+1)> (%i, %j)
%12 = load %A[%1, %2] : memref<8x?xi32, #layout, memspace0>
// Example of an indirect load (treated as non-affine)
-%3 = affine.apply (d0) -> (2*d0 + 1)(%12)
+%3 = affine.apply affine_map<(d0) -> (2*d0 + 1)>(%12)
%13 = load %A[%3, %2] : memref<4x?xi32, #layout, memspace0>
```
diff --git a/mlir/docs/LangRef.md b/mlir/docs/LangRef.md
index 82b740e50ea..cfb2955e8d4 100644
--- a/mlir/docs/LangRef.md
+++ b/mlir/docs/LangRef.md
@@ -852,20 +852,20 @@ Examples of memref static type
```mlir
// Identity index/layout map
-#identity = (d0, d1) -> (d0, d1)
+#identity = affine_map<(d0, d1) -> (d0, d1)>
// Column major layout.
-#col_major = (d0, d1, d2) -> (d2, d1, d0)
+#col_major = affine_map<(d0, d1, d2) -> (d2, d1, d0)>
// A 2-d tiled layout with tiles of size 128 x 256.
-#tiled_2d_128x256 = (d0, d1) -> (d0 div 128, d1 div 256, d0 mod 128, d1 mod 256)
+#tiled_2d_128x256 = affine_map<(d0, d1) -> (d0 div 128, d1 div 256, d0 mod 128, d1 mod 256)>
// A tiled data layout with non-constant tile sizes.
-#tiled_dynamic = (d0, d1)[s0, s1] -> (d0 floordiv s0, d1 floordiv s1,
- d0 mod s0, d1 mod s1)
+#tiled_dynamic = affine_map<(d0, d1)[s0, s1] -> (d0 floordiv s0, d1 floordiv s1,
+ d0 mod s0, d1 mod s1)>
// A layout that yields a padding on two at either end of the minor dimension.
-#padded = (d0, d1) -> (d0, (d1 + 2) floordiv 2, (d1 + 2) mod 2)
+#padded = affine_map<(d0, d1) -> (d0, (d1 + 2) floordiv 2, (d1 + 2) mod 2)>
// The dimension list "16x32" defines the following 2D index space:
@@ -897,7 +897,7 @@ memref<16x32xf32, #identity, memspace0>
%P = alloc() : memref<16x64xf32, #padded>
// Affine map with symbol 's0' used as offset for the first dimension.
-#imapS = (d0, d1) [s0] -> (d0 + s0, d1)
+#imapS = affine_map<(d0, d1) [s0] -> (d0 + s0, d1)>
// Allocate memref and bind the following symbols:
// '%n' is bound to the dynamic second dimension of the memref type.
// '%o' is bound to the symbol 's0' in the affine map of the memref type.
@@ -1188,10 +1188,10 @@ These aliases *must* be defined before their uses. Alias names may not contain a
Example:
```mlir
-#map = (d0) -> (d0 + 10)
+#map = affine_map<(d0) -> (d0 + 10)>
// Using the original attribute.
-%b = affine.apply (d0) -> (d0 + 10) (%a)
+%b = affine.apply affine_map<(d0) -> (d0 + 10)> (%a)
// Using the attribute alias.
%b = affine.apply #map(%a)
@@ -1262,7 +1262,7 @@ standard-attribute ::= affine-map-attribute
Syntax:
```
-affine-map-attribute ::= affine-map
+affine-map-attribute ::= `affine_map` `<` affine-map `>`
```
An affine-map attribute is an attribute that represents a affine-map object.
@@ -1419,7 +1419,7 @@ is not specified, is a 64-bit integer.
Syntax:
```
-integer-set-attribute ::= affine-map
+integer-set-attribute ::= `affine_set` `<` integer-set `>`
```
An integer-set attribute is an attribute that represents an integer-set object.
OpenPOWER on IntegriCloud