Skip to content

Commit a021db3

Browse files
DamonFooljpienaar
authored andcommitted
[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
1 parent d989950 commit a021db3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ struct ConvertRewriter : public OpRewritePattern<ConvertOp> {
839839
} else {
840840
// Gather the indices-arrays in the dst tensor storage order.
841841
SmallVector<Value> xs(rank, Value());
842-
for (uint64_t i = 0; i < rank; i++) {
842+
for (int64_t i = 0; i < rank; i++) {
843843
uint64_t orgDim = toOrigDim(encSrc, i);
844844
xs[toStoredDim(encDst, orgDim)] =
845845
genToIndices(rewriter, loc, src, i, /*cooStart=*/0);

0 commit comments

Comments
 (0)