Skip to content

Commit 54fefb3

Browse files
committed
[LV][NFC] Improve readability with bool instead of auto
1 parent 88a239d commit 54fefb3

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,7 +3204,7 @@ void LoopVectorizationCostModel::collectLoopScalars(ElementCount VF) {
32043204

32053205
// Determine if all users of the induction variable are scalar after
32063206
// vectorization.
3207-
auto ScalarInd = llvm::all_of(Ind->users(), [&](User *U) -> bool {
3207+
bool ScalarInd = llvm::all_of(Ind->users(), [&](User *U) -> bool {
32083208
auto *I = cast<Instruction>(U);
32093209
return I == IndUpdate || !TheLoop->contains(I) || Worklist.count(I) ||
32103210
IsDirectLoadStoreFromPtrIndvar(Ind, I);
@@ -3221,7 +3221,7 @@ void LoopVectorizationCostModel::collectLoopScalars(ElementCount VF) {
32213221

32223222
// Determine if all users of the induction variable update instruction are
32233223
// scalar after vectorization.
3224-
auto ScalarIndUpdate =
3224+
bool ScalarIndUpdate =
32253225
llvm::all_of(IndUpdate->users(), [&](User *U) -> bool {
32263226
auto *I = cast<Instruction>(U);
32273227
return I == Ind || !TheLoop->contains(I) || Worklist.count(I) ||
@@ -3649,11 +3649,10 @@ void LoopVectorizationCostModel::collectLoopUniforms(ElementCount VF) {
36493649
if (IsOutOfScope(V))
36503650
continue;
36513651
auto *I = cast<Instruction>(V);
3652-
auto UsersAreMemAccesses =
3653-
llvm::all_of(I->users(), [&](User *U) -> bool {
3654-
auto *UI = cast<Instruction>(U);
3655-
return TheLoop->contains(UI) && IsVectorizedMemAccessUse(UI, V);
3656-
});
3652+
bool UsersAreMemAccesses = llvm::all_of(I->users(), [&](User *U) -> bool {
3653+
auto *UI = cast<Instruction>(U);
3654+
return TheLoop->contains(UI) && IsVectorizedMemAccessUse(UI, V);
3655+
});
36573656
if (UsersAreMemAccesses)
36583657
AddToWorklistIfAllowed(I);
36593658
}
@@ -3698,7 +3697,7 @@ void LoopVectorizationCostModel::collectLoopUniforms(ElementCount VF) {
36983697

36993698
// Determine if all users of the induction variable are uniform after
37003699
// vectorization.
3701-
auto UniformInd = llvm::all_of(Ind->users(), [&](User *U) -> bool {
3700+
bool UniformInd = llvm::all_of(Ind->users(), [&](User *U) -> bool {
37023701
auto *I = cast<Instruction>(U);
37033702
return I == IndUpdate || !TheLoop->contains(I) || Worklist.count(I) ||
37043703
IsVectorizedMemAccessUse(I, Ind);
@@ -3708,7 +3707,7 @@ void LoopVectorizationCostModel::collectLoopUniforms(ElementCount VF) {
37083707

37093708
// Determine if all users of the induction variable update instruction are
37103709
// uniform after vectorization.
3711-
auto UniformIndUpdate =
3710+
bool UniformIndUpdate =
37123711
llvm::all_of(IndUpdate->users(), [&](User *U) -> bool {
37133712
auto *I = cast<Instruction>(U);
37143713
return I == Ind || !TheLoop->contains(I) || Worklist.count(I) ||

0 commit comments

Comments
 (0)