[Mlir-commits] [mlir] 2df0d29 - [mlir] Fix -Wsign-compare in AffineOps.cpp (NFC)

Jie Fu llvmlistbot at llvm.org
Thu Nov 28 22:12:54 PST 2024


Author: Jie Fu
Date: 2024-11-29T14:11:57+08:00
New Revision: 2df0d2962725a26a1d8c438888f7e70946943589

URL: https://github.com/llvm/llvm-project/commit/2df0d2962725a26a1d8c438888f7e70946943589
DIFF: https://github.com/llvm/llvm-project/commit/2df0d2962725a26a1d8c438888f7e70946943589.diff

LOG: [mlir] Fix -Wsign-compare in AffineOps.cpp (NFC)

/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:4590:25:
error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
  if (dynamicBasisIndex == dynamicBasis.size())
      ~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~
1 error generated.

Added: 
    

Modified: 
    mlir/lib/Dialect/Affine/IR/AffineOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
index 03549fb2e0fa91..dceebbfec586c8 100644
--- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
@@ -4577,7 +4577,7 @@ static std::optional<SmallVector<int64_t>>
 foldCstValueToCstAttrBasis(ArrayRef<OpFoldResult> mixedBasis,
                            MutableOperandRange mutableDynamicBasis,
                            ArrayRef<Attribute> dynamicBasis) {
-  int64_t dynamicBasisIndex = 0;
+  uint64_t dynamicBasisIndex = 0;
   for (OpFoldResult basis : dynamicBasis) {
     if (basis) {
       mutableDynamicBasis.erase(dynamicBasisIndex);


        


More information about the Mlir-commits mailing list