Skip to content

Commit d47a0ac

Browse files
committed
[mlir][Linalg] fix comparison of integers with different signs
Since https://reviews.llvm.org/D142053, building mlir with clang using -Werror fails reporting comparison of integers with different signs. Fix this by using unsigned return types for RelayoutOp::getSourceRank,getDestRank Differential Revision: https://reviews.llvm.org/D142201
1 parent 6d11baf commit d47a0ac

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,8 +1667,8 @@ class Tensor_RelayoutOp<string mnemonic, list<Trait> traits = []> :
16671667
"$_self">])> {
16681668

16691669
code commonExtraClassDeclaration = [{
1670-
int64_t getSourceRank() { return getSource().getType().getRank(); };
1671-
int64_t getDestRank() { return getDest().getType().getRank(); };
1670+
size_t getSourceRank() { return getSource().getType().getRank(); };
1671+
size_t getDestRank() { return getDest().getType().getRank(); };
16721672
RankedTensorType getSourceType() {
16731673
return getSource().getType().cast<RankedTensorType>(); };
16741674
RankedTensorType getDestType() {

mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ bool isValidPackingPermutation(
12211221
"applies to only pack or unpack operations");
12221222
if (!op || permutation.empty())
12231223
return true;
1224-
int64_t innerRank = op.getInnerDimsPos().size();
1224+
size_t innerRank = op.getInnerDimsPos().size();
12251225
if (outerOrInnerPerm == OuterOrInnerPerm::Inner)
12261226
return permutation.size() == innerRank && isPermutationVector(permutation);
12271227
// op.getOuterDimsPerm() may be empty, in which case it is identity.

0 commit comments

Comments
 (0)