[Mlir-commits] [mlir] [mlir][nfc] Fix assertion text in IndexingUtils.cpp (PR #181826)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Feb 17 06:21:38 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Akimasa Watanuki (Men-cotton)
<details>
<summary>Changes</summary>
Update the assertion text to match the actual code behavior.
The `computeProduct` and `linearize` functions enforce strictly positive values, whereas the error message incorrectly mentioned "nonnegative".
---
Full diff: https://github.com/llvm/llvm-project/pull/181826.diff
1 Files Affected:
- (modified) mlir/lib/Dialect/Utils/IndexingUtils.cpp (+2-2)
``````````diff
diff --git a/mlir/lib/Dialect/Utils/IndexingUtils.cpp b/mlir/lib/Dialect/Utils/IndexingUtils.cpp
index 898c2c0beb6a6..e53f6c5314313 100644
--- a/mlir/lib/Dialect/Utils/IndexingUtils.cpp
+++ b/mlir/lib/Dialect/Utils/IndexingUtils.cpp
@@ -83,13 +83,13 @@ SmallVector<int64_t> mlir::computeElementwiseMul(ArrayRef<int64_t> v1,
int64_t mlir::computeProduct(ArrayRef<int64_t> basis) {
assert(llvm::all_of(basis, [](int64_t s) { return s > 0; }) &&
- "basis must be nonnegative");
+ "basis must be positive");
return llvm::product_of(basis);
}
int64_t mlir::linearize(ArrayRef<int64_t> offsets, ArrayRef<int64_t> basis) {
assert(llvm::all_of(basis, [](int64_t s) { return s > 0; }) &&
- "basis must be nonnegative");
+ "basis must be positive");
int64_t zero = 0;
return linearizeImpl(offsets, basis, zero);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/181826
More information about the Mlir-commits
mailing list