diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp --- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp +++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp @@ -618,7 +618,7 @@ uint64_t rank = dstTp.getRank(); // Gather the indices-arrays in the dst tensor storage order. SmallVector xs(rank, Value()); - for (int64_t i = 0; i < rank; i++) { + for (uint64_t i = 0; i < rank; i++) { uint64_t orgDim = toOrigDim(encSrc, i); xs[toStoredDim(encDst, orgDim)] = rewriter.create( loc, indTp, src, rewriter.getIndexAttr(orgDim));