[llvm] 0508ac3 - [Vectorize] Fix a warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri May 26 17:02:45 PDT 2023


Author: Kazu Hirata
Date: 2023-05-26T17:02:34-07:00
New Revision: 0508ac32cfcc1a9fc5a81d16de8d418dc5a0666b

URL: https://github.com/llvm/llvm-project/commit/0508ac32cfcc1a9fc5a81d16de8d418dc5a0666b
DIFF: https://github.com/llvm/llvm-project/commit/0508ac32cfcc1a9fc5a81d16de8d418dc5a0666b.diff

LOG: [Vectorize] Fix a warning

This patch fixes:

  llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:1429:23:
  error: comparison of integers of different signs: 'int' and 'const
  size_t' (aka 'const unsigned long') [-Werror,-Wsign-compare]

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
index 52c6a9ff16bd..97c72e46288d 100644
--- a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
@@ -1426,7 +1426,7 @@ std::vector<Chain> Vectorizer::gatherChains(ArrayRef<Instruction *> Instrs) {
 
     bool MatchFound = false;
     auto ChainIter = MRU.begin();
-    for (int J = 0; J < MaxChainsToTry && ChainIter != MRU.end();
+    for (size_t J = 0; J < MaxChainsToTry && ChainIter != MRU.end();
          ++J, ++ChainIter) {
       std::optional<APInt> Offset =
           getConstantOffset(getLoadStorePointerOperand(ChainIter->first),


        


More information about the llvm-commits mailing list