[llvm] ea41ac1 - [SLP][NFC]Fix a warning for comparison of integers of different signs.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 16:06:19 PDT 2024


Author: Alexey Bataev
Date: 2024-03-14T16:06:08-07:00
New Revision: ea41ac1132def401ad5bb7c353be8f0e9f04698a

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

LOG: [SLP][NFC]Fix a warning for comparison of integers of different signs.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index b4cce680e2876f..4481306209d49f 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -4346,9 +4346,10 @@ BoUpSLP::LoadsState BoUpSLP::canVectorizeLoads(
     // increases the cost.
     Loop *L = LI->getLoopFor(cast<LoadInst>(VL0)->getParent());
     bool ProfitableGatherPointers =
-        L && Sz > 2 && count_if(PointerOps, [L](Value *V) {
-                         return L->isLoopInvariant(V);
-                       }) <= Sz / 2;
+        L && Sz > 2 &&
+        static_cast<unsigned>(count_if(PointerOps, [L](Value *V) {
+          return L->isLoopInvariant(V);
+        })) <= Sz / 2;
     if (ProfitableGatherPointers || all_of(PointerOps, [IsSorted](Value *P) {
           auto *GEP = dyn_cast<GetElementPtrInst>(P);
           return (IsSorted && !GEP && doesNotNeedToBeScheduled(P)) ||


        


More information about the llvm-commits mailing list