Skip to content

Commit

Permalink
[mlir][linalg] Fix signed/unsigned comparison warnings (NFC).
Browse files Browse the repository at this point in the history
Fix signedness warnings in Utils.cpp and LinalgInterfaces.cpp.
  • Loading branch information
Tobias Gysi committed Jun 1, 2021
1 parent d4c070d commit 07576cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ LogicalResult mlir::linalg::detail::verifyStructuredOpInterface(Operation *op) {
return failure();

// All shaped operands must be indexed.
if (linalgOp.indexing_maps().size() != linalgOp.getNumInputsAndOutputs())
if (static_cast<int64_t>(linalgOp.indexing_maps().size()) !=
linalgOp.getNumInputsAndOutputs())
return op->emitOpError("expected the number of indexing_map (")
<< linalgOp.indexing_maps().size()
<< ") to be equal to the number of input/output operands ("
Expand Down
3 changes: 2 additions & 1 deletion mlir/lib/Dialect/Linalg/Utils/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ SmallVector<Value, 4> makeTiledShapes(OpBuilder &b, Location loc,
LLVM_DEBUG(llvm::dbgs() << "size: " << subShapeSizes.back() << "\n");
}

assert(valuesToTile.size() == linalgOp.getNumInputsAndOutputs() &&
assert(static_cast<int64_t>(valuesToTile.size()) ==
linalgOp.getNumInputsAndOutputs() &&
"expected one value to tile for every operand");
MLIRContext *context = b.getContext();
SmallVector<Value, 4> tiledShapes;
Expand Down

0 comments on commit 07576cc

Please sign in to comment.