[Mlir-commits] [mlir] NFC: MLIR Indexing Utils comment fix (PR #183438)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Feb 25 18:53:49 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Ryan Thomas Lynch (emosy)
<details>
<summary>Changes</summary>
the comment for delinearize was incorrect and swapped modulus and division, updated comment to match code
---
Full diff: https://github.com/llvm/llvm-project/pull/183438.diff
1 Files Affected:
- (modified) mlir/include/mlir/Dialect/Utils/IndexingUtils.h (+2-2)
``````````diff
diff --git a/mlir/include/mlir/Dialect/Utils/IndexingUtils.h b/mlir/include/mlir/Dialect/Utils/IndexingUtils.h
index 8524072929793..daf9b0df41916 100644
--- a/mlir/include/mlir/Dialect/Utils/IndexingUtils.h
+++ b/mlir/include/mlir/Dialect/Utils/IndexingUtils.h
@@ -81,7 +81,7 @@ int64_t linearize(ArrayRef<int64_t> offsets, ArrayRef<int64_t> basis);
///
/// Let `li = linearIndex`, assuming `strides` are `[s0, .. sn]`, return the
/// vector of int64_t
-/// `[li % s0, (li / s0) % s1, ..., (li / s0 / .. / sn-1) % sn]`
+/// `[li / s0, (li % s0) / s1, ..., (li % s0 % .. % sn-1) / sn]`
SmallVector<int64_t> delinearize(int64_t linearIndex,
ArrayRef<int64_t> strides);
@@ -181,7 +181,7 @@ AffineExpr linearize(MLIRContext *ctx, ArrayRef<AffineExpr> offsets,
///
/// Let `li = linearIndex`, assuming `strides` are `[s0, .. sn]`, return the
/// vector of AffineExpr
-/// `[li % s0, (li / s0) % s1, ..., (li / s0 / .. / sn-1) % sn]`
+/// `[li / s0, (li % s0) / s1, ..., (li % s0 % .. % sn-1) / sn]`
///
/// It is the caller's responsibility to pass proper AffineExpr kind that result
/// in valid AffineExpr (i.e. cannot multiply 2 AffineDimExpr or divide by an
``````````
</details>
https://github.com/llvm/llvm-project/pull/183438
More information about the Mlir-commits
mailing list