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

Kazu Hirata llvmlistbot at llvm.org
Mon Oct 10 12:57:34 PDT 2022


Author: Kazu Hirata
Date: 2022-10-10T12:57:25-07:00
New Revision: d208baee65ec15a2ea15ec17e8fe676b07296ad9

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

LOG: [mlir] Fix a warning

This patch fixes:

  mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1051:40: error: comparison
  of integers of different signs: 'int64_t' (aka 'long') and
  'std::size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
index 79961b72fcd3..eaa192358f11 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
@@ -1048,7 +1048,8 @@ struct DeduplicateAndRemoveDeadOperandsAndResults
           genericOp.getMatchingIndexingMap(outputOpOperand.value());
       auto key = std::make_tuple(outputOpOperand.value()->get(), indexingMap,
                                  yieldOp->getOperand(outputOpOperand.index()));
-      assert(genericOp.getNumOutputs() >= outputOpOperand.index() &&
+      assert(static_cast<std::size_t>(genericOp.getNumOutputs()) >=
+                 outputOpOperand.index() &&
              "Output op idx greater than number of outputs.");
       if (isResultValueDead(genericOp, result)) {
         // Check if the opoperand can be dropped without affecting loop


        


More information about the Mlir-commits mailing list