@@ -978,8 +978,9 @@ void SelectOptimizeImpl::findProfitableSIGroupsInnerLoops(
978
978
// cost of the most expensive instruction of the group.
979
979
Scaled64 SelectCost = Scaled64::getZero (), BranchCost = Scaled64::getZero ();
980
980
for (SelectLike &SI : ASI.Selects ) {
981
- SelectCost = std::max (SelectCost, InstCostMap[SI.getI ()].PredCost );
982
- BranchCost = std::max (BranchCost, InstCostMap[SI.getI ()].NonPredCost );
981
+ const auto &ICM = InstCostMap[SI.getI ()];
982
+ SelectCost = std::max (SelectCost, ICM.PredCost );
983
+ BranchCost = std::max (BranchCost, ICM.NonPredCost );
983
984
}
984
985
if (BranchCost < SelectCost) {
985
986
OptimizationRemark OR (DEBUG_TYPE, " SelectOpti" ,
@@ -1327,8 +1328,8 @@ bool SelectOptimizeImpl::computeLoopCosts(
1327
1328
// BranchCost = PredictedPathCost + MispredictCost
1328
1329
// PredictedPathCost = TrueOpCost * TrueProb + FalseOpCost * FalseProb
1329
1330
// MispredictCost = max(MispredictPenalty, CondCost) * MispredictRate
1330
- if (SImap.contains (&I)) {
1331
- auto SI = SImap. at (&I) ;
1331
+ if (auto It = SImap.find (&I); It != SImap. end ( )) {
1332
+ auto SI = It-> second ;
1332
1333
const auto *SG = SGmap.at (&I);
1333
1334
Scaled64 TrueOpCost = SI.getOpCostOnBranch (true , InstCostMap, TTI);
1334
1335
Scaled64 FalseOpCost = SI.getOpCostOnBranch (false , InstCostMap, TTI);
0 commit comments