@@ -1109,29 +1109,29 @@ def AffineLinearizeIndexOp : Affine_Op<"linearize_index",
11091109 The `affine.linearize_index` operation takes a sequence of index values and a
11101110 basis of the same length and linearizes the indices using that basis.
11111111
1112- That is, for indices `%idx_1` through `%i_N ` and basis elements `b_1` through `b_N`,
1112+ That is, for indices `%idx_1` through `%idx_N ` and basis elements `b_1` through `b_N`,
11131113 it computes
11141114
11151115 ```
11161116 sum(i = 1 to N) %idx_i * product(j = i + 1 to N) B_j
11171117 ```
11181118
11191119 If the `disjoint` property is present, this is an optimization hint that,
1120- for all i, 0 <= %idx_i < B_i - that is, no index affects any other index,
1121- except that %idx_0 may be negative to make the index as a whole negative.
1120+ for all `i`, ` 0 <= %idx_i < B_i` - that is, no index affects any other index,
1121+ except that ` %idx_0` may be negative to make the index as a whole negative.
11221122
11231123 Note that the outputs of `affine.delinearize_index` are, by definition, `disjoint`.
11241124
11251125 Example:
11261126
11271127 ```mlir
1128- %linear_index = affine.delinearize_index [%index_0, %index_1, %index_2] (16, 224, 224 ) : index
1128+ %linear_index = affine.linearize_index [%index_0, %index_1, %index_2] (2, 3, 5 ) : index
11291129 ```
11301130
11311131 In the above example, `%linear_index` conceptually holds the following:
11321132
11331133 ```mlir
1134- #map = affine_map<()[s0, s1, s2] -> (s0 * 50176 + s1 * 224 + s2)>
1134+ #map = affine_map<()[s0, s1, s2] -> (s0 * 15 + s1 * 5 + s2)>
11351135 %linear_index = affine.apply #map()[%index_0, %index_1, %index_2]
11361136 ```
11371137 }];
0 commit comments