Skip to content

Commit 99ab848

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (#122861)
1 parent 466753b commit 99ab848

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/CodeGen/ModuloSchedule.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,8 @@ class PeelingModuloScheduleExpander {
359359
MachineBasicBlock *CreateLCSSAExitingBlock();
360360
/// Helper to get the stage of an instruction in the schedule.
361361
unsigned getStage(MachineInstr *MI) {
362-
if (CanonicalMIs.count(MI))
363-
MI = CanonicalMIs[MI];
362+
if (auto It = CanonicalMIs.find(MI); It != CanonicalMIs.end())
363+
MI = It->second;
364364
return Schedule.getStage(MI);
365365
}
366366
/// Helper function to find the right canonical register for a phi instruction

0 commit comments

Comments
 (0)