Skip to content

Commit ea41ac1

Browse files
committed
[SLP][NFC]Fix a warning for comparison of integers of different signs.
1 parent 3ed8f19 commit ea41ac1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4346,9 +4346,10 @@ BoUpSLP::LoadsState BoUpSLP::canVectorizeLoads(
43464346
// increases the cost.
43474347
Loop *L = LI->getLoopFor(cast<LoadInst>(VL0)->getParent());
43484348
bool ProfitableGatherPointers =
4349-
L && Sz > 2 && count_if(PointerOps, [L](Value *V) {
4350-
return L->isLoopInvariant(V);
4351-
}) <= Sz / 2;
4349+
L && Sz > 2 &&
4350+
static_cast<unsigned>(count_if(PointerOps, [L](Value *V) {
4351+
return L->isLoopInvariant(V);
4352+
})) <= Sz / 2;
43524353
if (ProfitableGatherPointers || all_of(PointerOps, [IsSorted](Value *P) {
43534354
auto *GEP = dyn_cast<GetElementPtrInst>(P);
43544355
return (IsSorted && !GEP && doesNotNeedToBeScheduled(P)) ||

0 commit comments

Comments
 (0)