File tree 1 file changed +6
-9
lines changed
llvm/lib/Transforms/Vectorize
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -4594,15 +4594,12 @@ ElementCount LoopVectorizationCostModel::getMaximizedVFForTarget(
4594
4594
4595
4595
// Select the largest VF which doesn't require more registers than existing
4596
4596
// ones.
4597
- for (int i = RUs.size () - 1 ; i >= 0 ; --i) {
4598
- bool Selected = true ;
4599
- for (auto &pair : RUs[i].MaxLocalUsers ) {
4600
- unsigned TargetNumRegisters = TTI.getNumberOfRegisters (pair.first );
4601
- if (pair.second > TargetNumRegisters)
4602
- Selected = false ;
4603
- }
4604
- if (Selected) {
4605
- MaxVF = VFs[i];
4597
+ for (int I = RUs.size () - 1 ; I >= 0 ; --I) {
4598
+ const auto &MLU = RUs[I].MaxLocalUsers ;
4599
+ if (all_of (MLU, [&](decltype (MLU.front ()) &LU) {
4600
+ return LU.second <= TTI.getNumberOfRegisters (LU.first );
4601
+ })) {
4602
+ MaxVF = VFs[I];
4606
4603
break ;
4607
4604
}
4608
4605
}
You can’t perform that action at this time.
0 commit comments