[mlir] Fix a warning
authorKazu Hirata <kazu@google.com>
Mon, 10 Oct 2022 19:57:25 +0000 (12:57 -0700)
committerKazu Hirata <kazu@google.com>
Mon, 10 Oct 2022 19:57:25 +0000 (12:57 -0700)
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]

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

index 79961b7..eaa1923 100644 (file)
@@ -1048,7 +1048,8 @@ private:
           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