@@ -3206,7 +3206,7 @@ void LoopVectorizationCostModel::collectLoopScalars(ElementCount VF) {
3206
3206
3207
3207
// Determine if all users of the induction variable are scalar after
3208
3208
// vectorization.
3209
- auto ScalarInd = llvm:: all_of (Ind->users (), [&](User *U) -> bool {
3209
+ bool ScalarInd = all_of (Ind->users (), [&](User *U) -> bool {
3210
3210
auto *I = cast<Instruction>(U);
3211
3211
return I == IndUpdate || !TheLoop->contains (I) || Worklist.count (I) ||
3212
3212
IsDirectLoadStoreFromPtrIndvar (Ind, I);
@@ -3223,12 +3223,11 @@ void LoopVectorizationCostModel::collectLoopScalars(ElementCount VF) {
3223
3223
3224
3224
// Determine if all users of the induction variable update instruction are
3225
3225
// scalar after vectorization.
3226
- auto ScalarIndUpdate =
3227
- llvm::all_of (IndUpdate->users (), [&](User *U) -> bool {
3228
- auto *I = cast<Instruction>(U);
3229
- return I == Ind || !TheLoop->contains (I) || Worklist.count (I) ||
3230
- IsDirectLoadStoreFromPtrIndvar (IndUpdate, I);
3231
- });
3226
+ bool ScalarIndUpdate = all_of (IndUpdate->users (), [&](User *U) -> bool {
3227
+ auto *I = cast<Instruction>(U);
3228
+ return I == Ind || !TheLoop->contains (I) || Worklist.count (I) ||
3229
+ IsDirectLoadStoreFromPtrIndvar (IndUpdate, I);
3230
+ });
3232
3231
if (!ScalarIndUpdate)
3233
3232
continue ;
3234
3233
@@ -3651,11 +3650,10 @@ void LoopVectorizationCostModel::collectLoopUniforms(ElementCount VF) {
3651
3650
if (IsOutOfScope (V))
3652
3651
continue ;
3653
3652
auto *I = cast<Instruction>(V);
3654
- auto UsersAreMemAccesses =
3655
- llvm::all_of (I->users (), [&](User *U) -> bool {
3656
- auto *UI = cast<Instruction>(U);
3657
- return TheLoop->contains (UI) && IsVectorizedMemAccessUse (UI, V);
3658
- });
3653
+ bool UsersAreMemAccesses = all_of (I->users (), [&](User *U) -> bool {
3654
+ auto *UI = cast<Instruction>(U);
3655
+ return TheLoop->contains (UI) && IsVectorizedMemAccessUse (UI, V);
3656
+ });
3659
3657
if (UsersAreMemAccesses)
3660
3658
AddToWorklistIfAllowed (I);
3661
3659
}
@@ -3700,7 +3698,7 @@ void LoopVectorizationCostModel::collectLoopUniforms(ElementCount VF) {
3700
3698
3701
3699
// Determine if all users of the induction variable are uniform after
3702
3700
// vectorization.
3703
- auto UniformInd = llvm:: all_of (Ind->users (), [&](User *U) -> bool {
3701
+ bool UniformInd = all_of (Ind->users (), [&](User *U) -> bool {
3704
3702
auto *I = cast<Instruction>(U);
3705
3703
return I == IndUpdate || !TheLoop->contains (I) || Worklist.count (I) ||
3706
3704
IsVectorizedMemAccessUse (I, Ind);
@@ -3710,12 +3708,11 @@ void LoopVectorizationCostModel::collectLoopUniforms(ElementCount VF) {
3710
3708
3711
3709
// Determine if all users of the induction variable update instruction are
3712
3710
// uniform after vectorization.
3713
- auto UniformIndUpdate =
3714
- llvm::all_of (IndUpdate->users (), [&](User *U) -> bool {
3715
- auto *I = cast<Instruction>(U);
3716
- return I == Ind || !TheLoop->contains (I) || Worklist.count (I) ||
3717
- IsVectorizedMemAccessUse (I, IndUpdate);
3718
- });
3711
+ bool UniformIndUpdate = all_of (IndUpdate->users (), [&](User *U) -> bool {
3712
+ auto *I = cast<Instruction>(U);
3713
+ return I == Ind || !TheLoop->contains (I) || Worklist.count (I) ||
3714
+ IsVectorizedMemAccessUse (I, IndUpdate);
3715
+ });
3719
3716
if (!UniformIndUpdate)
3720
3717
continue ;
3721
3718
0 commit comments