This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Use unsigned return type for RelayoutOp::getSourceRank,getDestRank
ClosedPublic

Authored by tblah on Jan 20 2023, 4:24 AM.

Details

Summary

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) size_t instead of (signed) int64_t for comparisons
with other size_t values.

Diff Detail

Event Timeline

tblah created this revision.Jan 20 2023, 4:24 AM
tblah requested review of this revision.Jan 20 2023, 4:24 AM

Agree, let's fix getSourceRank and getDestRank. The change should be simple: https://github.com/llvm/llvm-project/blob/b0d575310f2ee660dadfdaf1e06bac148a575754/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td#L1670 Do you want to give it a try?

tblah updated this revision to Diff 490799.Jan 20 2023, 5:51 AM

Updated getSourceRank and getDestRank to return size_t to avoid comparison
between int64_t and size_t.

chelini accepted this revision.Jan 20 2023, 6:08 AM

Thank you! Mind updating the summary and title? After that, for me, you can land it.

This revision is now accepted and ready to land.Jan 20 2023, 6:08 AM
tblah retitled this revision from [mlir][Linalg] fix comparison of integers with different signs to [mlir][Linalg] Use unsigned return type for RelayoutOp::getSourceRank,getDestRank.Jan 20 2023, 6:11 AM
tblah edited the summary of this revision. (Show Details)