[mlir] Fix a warning (NFC)
authorKazu Hirata <kazu@google.com>
Mon, 7 Nov 2022 17:54:10 +0000 (09:54 -0800)
committerKazu Hirata <kazu@google.com>
Mon, 7 Nov 2022 17:54:10 +0000 (09:54 -0800)
This patch fixes:

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

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

index b0c88e1..6d6bd26 100644 (file)
@@ -714,7 +714,7 @@ LogicalResult SortCooOp::verify() {
   auto checkDim = [&](Value v, uint64_t min, const char *message) {
     MemRefType tp = v.getType().cast<MemRefType>();
     int64_t dim = tp.getShape()[0];
-    if (dim != ShapedType::kDynamicSize && dim < min) {
+    if (dim != ShapedType::kDynamicSize && dim < (int64_t)min) {
       emitError(llvm::formatv("{0} got {1} < {2}", message, dim, min));
     }
   };