[Mlir-commits] [mlir] a021db3 - [mlir] Fix build error due to -Wsign-compare after revision D140871
Jacques Pienaar
llvmlistbot at llvm.org
Thu Jan 5 19:36:19 PST 2023
Author: Jie Fu
Date: 2023-01-05T19:36:13-08:00
New Revision: a021db346e2969b82b443aff6c73377ab9658439
URL: https://github.com/llvm/llvm-project/commit/a021db346e2969b82b443aff6c73377ab9658439
DIFF: https://github.com/llvm/llvm-project/commit/a021db346e2969b82b443aff6c73377ab9658439.diff
LOG: [mlir] Fix build error due to -Wsign-compare after revision D140871
This patch fixes build failure due to -Wsign-compare in sparse2SparseRewrite(...) after https://reviews.llvm.org/D140871.
```
llvm-project/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp:842:32: error: comparison of integers of different signs: 'uint64_t' (aka 'unsigned long') and 'int64_t' (aka 'long') [-Werror,-Wsign-compare]
for (uint64_t i = 0; i < rank; i++) {
~ ^ ~~~~
1 error generated.
```
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D141104
Added:
Modified:
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
index d82d1e4b16e00..f923a1d27c377 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
@@ -839,7 +839,7 @@ struct ConvertRewriter : public OpRewritePattern<ConvertOp> {
} else {
// Gather the indices-arrays in the dst tensor storage order.
SmallVector<Value> xs(rank, Value());
- for (uint64_t i = 0; i < rank; i++) {
+ for (int64_t i = 0; i < rank; i++) {
uint64_t orgDim = toOrigDim(encSrc, i);
xs[toStoredDim(encDst, orgDim)] =
genToIndices(rewriter, loc, src, i, /*cooStart=*/0);
More information about the Mlir-commits
mailing list