Skip to content

Commit d386b3b

Browse files
authored
[SLP] Harmonise findLaneForValue() return type (NFC) (#148232)
The lane is computed as an unsigned, so let's return it as unsigned.
1 parent 798f4c1 commit d386b3b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3898,7 +3898,7 @@ class BoUpSLP {
38983898

38993899
/// When ReuseReorderShuffleIndices is empty it just returns position of \p
39003900
/// V within vector of Scalars. Otherwise, try to remap on its reuse index.
3901-
int findLaneForValue(Value *V) const {
3901+
unsigned findLaneForValue(Value *V) const {
39023902
unsigned FoundLane = getVectorFactor();
39033903
for (auto *It = find(Scalars, V), *End = Scalars.end(); It != End;
39043904
std::advance(It, 1)) {
@@ -4344,7 +4344,7 @@ class BoUpSLP {
43444344

43454345
/// This POD struct describes one external user in the vectorized tree.
43464346
struct ExternalUser {
4347-
ExternalUser(Value *S, llvm::User *U, const TreeEntry &E, int L)
4347+
ExternalUser(Value *S, llvm::User *U, const TreeEntry &E, unsigned L)
43484348
: Scalar(S), User(U), E(E), Lane(L) {}
43494349

43504350
/// Which scalar in our function.
@@ -4357,7 +4357,7 @@ class BoUpSLP {
43574357
const TreeEntry &E;
43584358

43594359
/// Which lane does the scalar belong to.
4360-
int Lane;
4360+
unsigned Lane;
43614361
};
43624362
using UserList = SmallVector<ExternalUser, 16>;
43634363

@@ -7901,7 +7901,7 @@ void BoUpSLP::buildExternalUses(
79017901
// Check if the scalar is externally used as an extra arg.
79027902
const auto ExtI = ExternallyUsedValues.find(Scalar);
79037903
if (ExtI != ExternallyUsedValues.end()) {
7904-
int FoundLane = Entry->findLaneForValue(Scalar);
7904+
unsigned FoundLane = Entry->findLaneForValue(Scalar);
79057905
LLVM_DEBUG(dbgs() << "SLP: Need to extract: Extra arg from lane "
79067906
<< FoundLane << " from " << *Scalar << ".\n");
79077907
ScalarToExtUses.try_emplace(Scalar, ExternalUses.size());
@@ -7949,7 +7949,7 @@ void BoUpSLP::buildExternalUses(
79497949

79507950
if (U && Scalar->hasNUsesOrMore(UsesLimit))
79517951
U = nullptr;
7952-
int FoundLane = Entry->findLaneForValue(Scalar);
7952+
unsigned FoundLane = Entry->findLaneForValue(Scalar);
79537953
LLVM_DEBUG(dbgs() << "SLP: Need to extract:" << *UserInst
79547954
<< " from lane " << FoundLane << " from " << *Scalar
79557955
<< ".\n");

0 commit comments

Comments
 (0)