Skip to content

Commit dc39028

Browse files
committed
[mlir] Fix -Wsign-compare in ValueBoundsOpInterface.cpp (NFC)
/llvm-project/mlir/lib/Interfaces/ValueBoundsOpInterface.cpp:762:16: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare] rhsPos >= cstr.positionToValueDim.size()) ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /llvm-project/mlir/lib/Interfaces/ValueBoundsOpInterface.cpp:761:16: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare] if (lhsPos >= cstr.positionToValueDim.size() || ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated.
1 parent 21265f6 commit dc39028

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mlir/lib/Interfaces/ValueBoundsOpInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,8 @@ bool ValueBoundsConstraintSet::compare(AffineMap lhs, ValueDimList lhsOperands,
758758
auto stopCondition = [&](Value v, std::optional<int64_t> dim,
759759
ValueBoundsConstraintSet &cstr) {
760760
// Keep processing as long as lhs/rhs were not processed.
761-
if (lhsPos >= cstr.positionToValueDim.size() ||
762-
rhsPos >= cstr.positionToValueDim.size())
761+
if (size_t(lhsPos) >= cstr.positionToValueDim.size() ||
762+
size_t(rhsPos) >= cstr.positionToValueDim.size())
763763
return false;
764764
// Keep processing as long as the relation cannot be proven.
765765
return cstr.comparePos(lhsPos, cmp, rhsPos);

0 commit comments

Comments
 (0)