File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -4594,15 +4594,12 @@ ElementCount LoopVectorizationCostModel::getMaximizedVFForTarget(
45944594
45954595 // Select the largest VF which doesn't require more registers than existing
45964596 // 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];
46064603 break ;
46074604 }
46084605 }
You can’t perform that action at this time.
0 commit comments