[Mlir-commits] [mlir] aef9531 - [mlir] Fix a warning

Kazu Hirata llvmlistbot at llvm.org
Fri Jan 20 14:34:03 PST 2023


Author: Kazu Hirata
Date: 2023-01-20T14:33:57-08:00
New Revision: aef953154a08340bf379933ac6da02eb5dd8f3c8

URL: https://github.com/llvm/llvm-project/commit/aef953154a08340bf379933ac6da02eb5dd8f3c8
DIFF: https://github.com/llvm/llvm-project/commit/aef953154a08340bf379933ac6da02eb5dd8f3c8.diff

LOG: [mlir] Fix a warning

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]

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp b/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
index 0ad21a1729970..f2495da395023 100644
--- a/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
+++ b/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
@@ -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) {


        


More information about the Mlir-commits mailing list