File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -4392,13 +4392,15 @@ void LoopVectorizationPlanner::emitInvalidCostRemarks(
4392
4392
DenseMap<VPRecipeBase *, unsigned > Numbering;
4393
4393
unsigned I = 0 ;
4394
4394
for (auto &Pair : InvalidCosts)
4395
- if (! Numbering.count (Pair.first ) )
4396
- Numbering[Pair. first ] = I++ ;
4395
+ if (Numbering.try_emplace (Pair.first , I). second )
4396
+ ++I ;
4397
4397
4398
4398
// Sort the list, first on recipe(number) then on VF.
4399
4399
sort (InvalidCosts, [&Numbering](RecipeVFPair &A, RecipeVFPair &B) {
4400
- if (Numbering[A.first ] != Numbering[B.first ])
4401
- return Numbering[A.first ] < Numbering[B.first ];
4400
+ unsigned NA = Numbering[A.first ];
4401
+ unsigned NB = Numbering[B.first ];
4402
+ if (NA != NB)
4403
+ return NA < NB;
4402
4404
return ElementCount::isKnownLT (A.second , B.second );
4403
4405
});
4404
4406
You can’t perform that action at this time.
0 commit comments