Skip to content

Commit 0b396e5

Browse files
krzysz00kuhar
andauthored
Fixups and minor changes from code review
Co-authored-by: Jakub Kuderski <[email protected]>
1 parent e640096 commit 0b396e5

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

mlir/include/mlir/Dialect/Affine/IR/AffineOps.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ 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 `%i_N` and basis elements `b_1` through `b_N`,
11131113
it computes
11141114

11151115
```
@@ -1124,13 +1124,13 @@ def AffineLinearizeIndexOp : Affine_Op<"linearize_index",
11241124

11251125
Example:
11261126

1127-
```
1127+
```mlir
11281128
%linear_index = affine.delinearize_index [%index_0, %index_1, %index_2] (16, 224, 224) : index
11291129
```
11301130

11311131
In the above example, `%linear_index` conceptually holds the following:
11321132

1133-
```
1133+
```mlir
11341134
#map = affine_map<()[s0, s1, s2] -> (s0 * 50176 + s1 * 224 + s2)>
11351135
%linear_index = affine.apply #map()[%index_0, %index_1, %index_2]
11361136
```

mlir/lib/Dialect/Affine/IR/AffineOps.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4723,8 +4723,8 @@ namespace {
47234723
///
47244724
/// Alternatively, if `%x` in the above is a known constant 0, remove it even if
47254725
/// the operation isn't asserted to be `disjoint`.
4726-
struct DropLinearizeUnitComponentsIfDisjointOrZero
4727-
: public OpRewritePattern<affine::AffineLinearizeIndexOp> {
4726+
struct DropLinearizeUnitComponentsIfDisjointOrZero final
4727+
: OpRewritePattern<affine::AffineLinearizeIndexOp> {
47284728
using OpRewritePattern::OpRewritePattern;
47294729

47304730
LogicalResult matchAndRewrite(affine::AffineLinearizeIndexOp op,

mlir/lib/Dialect/Affine/Transforms/AffineExpandIndexOps.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ struct LowerDelinearizeIndexOps
4848

4949
/// Lowers `affine.linearize_index` into a sequence of multiplications and
5050
/// additions.
51-
struct LowerLinearizeIndexOps
52-
: public OpRewritePattern<AffineLinearizeIndexOp> {
53-
using OpRewritePattern<AffineLinearizeIndexOp>::OpRewritePattern;
51+
struct LowerLinearizeIndexOps final
52+
: OpRewritePattern<AffineLinearizeIndexOp> {
53+
using OpRewritePattern::OpRewritePattern;
5454
LogicalResult matchAndRewrite(AffineLinearizeIndexOp op,
5555
PatternRewriter &rewriter) const override {
5656
SmallVector<OpFoldResult> multiIndex =

0 commit comments

Comments
 (0)