[Mlir-commits] [mlir] 1e47888 - [mlir][sparse] fix compile-time warning
Aart Bik
llvmlistbot at llvm.org
Tue Mar 1 11:26:23 PST 2022
Author: Aart Bik
Date: 2022-03-01T11:26:15-08:00
New Revision: 1e47888de621cbff6d6d9e3f2101094e073022b0
URL: https://github.com/llvm/llvm-project/commit/1e47888de621cbff6d6d9e3f2101094e073022b0
DIFF: https://github.com/llvm/llvm-project/commit/1e47888de621cbff6d6d9e3f2101094e073022b0.diff
LOG: [mlir][sparse] fix compile-time warning
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D120756
Added:
Modified:
mlir/lib/ExecutionEngine/SparseTensorUtils.cpp
Removed:
################################################################################
diff --git a/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp b/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp
index 5f093a2b88733..f468b77a606cd 100644
--- a/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp
+++ b/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp
@@ -756,7 +756,7 @@ toMLIRSparseTensor(uint64_t rank, uint64_t nse, uint64_t *shape, V *values,
// Verify that perm is a permutation of 0..(rank-1).
std::vector<uint64_t> order(perm, perm + rank);
std::sort(order.begin(), order.end());
- for (int i = 0; i < rank; ++i) {
+ for (uint64_t i = 0; i < rank; ++i) {
if (i != order[i]) {
fprintf(stderr, "Permutation is not a permutation of 0..%lu\n", rank);
exit(1);
@@ -764,7 +764,7 @@ toMLIRSparseTensor(uint64_t rank, uint64_t nse, uint64_t *shape, V *values,
}
// Verify that the sparsity values are supported.
- for (int i = 0; i < rank; ++i) {
+ for (uint64_t i = 0; i < rank; ++i) {
if (sparsity[i] != DimLevelType::kDense &&
sparsity[i] != DimLevelType::kCompressed) {
fprintf(stderr, "Unsupported sparsity value %d\n",
More information about the Mlir-commits
mailing list