@@ -397,8 +397,9 @@ void ModuloScheduleExpander::generateExistingPhis(
397
397
// The Phi value from the loop body typically is defined in the loop, but
398
398
// not always. So, we need to check if the value is defined in the loop.
399
399
unsigned PhiOp2 = LoopVal;
400
- if (VRMap[LastStageNum].count (LoopVal))
401
- PhiOp2 = VRMap[LastStageNum][LoopVal];
400
+ if (auto It = VRMap[LastStageNum].find (LoopVal);
401
+ It != VRMap[LastStageNum].end ())
402
+ PhiOp2 = It->second ;
402
403
403
404
int StageScheduled = Schedule.getStage (&*BBI);
404
405
int LoopValStage = Schedule.getStage (MRI.getVRegDef (LoopVal));
@@ -1055,8 +1056,8 @@ void ModuloScheduleExpander::updateInstruction(MachineInstr *NewMI,
1055
1056
// Make an adjustment to get the last definition.
1056
1057
StageNum -= StageDiff;
1057
1058
}
1058
- if (VRMap[StageNum].count (reg))
1059
- MO.setReg (VRMap[StageNum][reg] );
1059
+ if (auto It = VRMap[StageNum].find (reg); It != VRMap[StageNum]. end ( ))
1060
+ MO.setReg (It-> second );
1060
1061
}
1061
1062
}
1062
1063
}
@@ -1710,8 +1711,8 @@ void PeelingModuloScheduleExpander::moveStageBetweenBlocks(
1710
1711
for (MachineOperand &MO : I->uses ()) {
1711
1712
if (!MO.isReg ())
1712
1713
continue ;
1713
- if (Remaps.count (MO.getReg ()))
1714
- MO.setReg (Remaps[MO. getReg ()] );
1714
+ if (auto It = Remaps.find (MO.getReg ()); It != Remaps. end ( ))
1715
+ MO.setReg (It-> second );
1715
1716
else {
1716
1717
// If we are using a phi from the source block we need to add a new phi
1717
1718
// pointing to the old one.
0 commit comments