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(
43924392 DenseMap<VPRecipeBase *, unsigned > Numbering;
43934393 unsigned I = 0 ;
43944394 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 ;
43974397
43984398 // Sort the list, first on recipe(number) then on VF.
43994399 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;
44024404 return ElementCount::isKnownLT (A.second , B.second );
44034405 });
44044406
You can’t perform that action at this time.
0 commit comments