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

Kazu Hirata llvmlistbot at llvm.org
Mon Mar 6 13:57:23 PST 2023


Author: Kazu Hirata
Date: 2023-03-06T13:57:16-08:00
New Revision: d83492c97d9c793212e692177299eb36d6ac928d

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

LOG: [mlir] Fix a warning

This patch fixes:

  mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp:675:56:
  error: comparison of integers of different signs: 'long const' and
  'const mlir::sparse_tensor::Level' (aka 'const unsigned 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 a17a5720e727c..9485d9463d26f 100644
--- a/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
+++ b/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
@@ -672,7 +672,7 @@ static LogicalResult verifyPackUnPack(Operation *op, bool requiresStaticShape,
   // level-coordinates (cf., the op documentation).
   const auto coordsRank = coordinatesTp.getShape()[1];
   const auto tensorRank = tensorTp.getLvlRank();
-  if (!ShapedType::isDynamic(coordsRank) && coordsRank != tensorRank)
+  if (!ShapedType::isDynamic(coordsRank) && (unsigned)coordsRank != tensorRank)
     return op->emitError("input/output level-ranks don't match");
 
   return success();


        


More information about the Mlir-commits mailing list