Skip to content

Commit f3f7f08

Browse files
authored
[SLP] Fix Wsign-compare warning (NFC) (#131948)
llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4805:57: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Wsign-compare] [](const auto &P) { return P.value() % 2 != P.index() % 2; })) ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
1 parent b8271ec commit f3f7f08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4802,7 +4802,9 @@ BoUpSLP::findReusedOrderedScalars(const BoUpSLP::TreeEntry &TE,
48024802
if (!Entries.front().front()->ReuseShuffleIndices.empty() &&
48034803
TE.getVectorFactor() == 2 && Mask.size() == 2 &&
48044804
any_of(enumerate(Entries.front().front()->ReuseShuffleIndices),
4805-
[](const auto &P) { return P.value() % 2 != P.index() % 2; }))
4805+
[](const auto &P) {
4806+
return P.value() % 2 != static_cast<int>(P.index()) % 2;
4807+
}))
48064808
return std::nullopt;
48074809

48084810
// Perfect match in the graph, will reuse the previously vectorized

0 commit comments

Comments
 (0)