[mlir] Fix a warning
authorKazu Hirata <kazu@google.com>
Fri, 20 Jan 2023 22:33:57 +0000 (14:33 -0800)
committerKazu Hirata <kazu@google.com>
Fri, 20 Jan 2023 22:33:57 +0000 (14:33 -0800)
This patch fixes:

  mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp:528:22:
  error: comparison of integers of different signs: 'uint64_t' (aka
  'unsigned long') and 'int64_t' (aka 'long') [-Werror,-Wsign-compare]

mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp

index 0ad21a1..f2495da 100644 (file)
@@ -525,7 +525,8 @@ Type StorageSpecifierType::getFieldType(StorageSpecifierKind kind,
 //===----------------------------------------------------------------------===//
 
 static LogicalResult isInBounds(uint64_t dim, Value tensor) {
-  return success(dim < tensor.getType().cast<RankedTensorType>().getRank());
+  return success(dim <
+                 (uint64_t)tensor.getType().cast<RankedTensorType>().getRank());
 }
 
 static LogicalResult isMatchingWidth(Value result, unsigned width) {