Skip to content

Commit 49cf69a

Browse files
[SystemZ] Avoid repeated hash lookups (NFC) (#130392)
1 parent 3e0c503 commit 49cf69a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/Target/SystemZ/SystemZMachineScheduler.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,16 @@ void SystemZPostRASchedStrategy::enterMBB(MachineBasicBlock *NextMBB) {
9494
// scheduled. If this is not possible, we are done.
9595
MachineBasicBlock *SinglePredMBB =
9696
getSingleSchedPred(MBB, MLI->getLoopFor(MBB));
97-
if (SinglePredMBB == nullptr ||
98-
SchedStates.find(SinglePredMBB) == SchedStates.end())
97+
if (SinglePredMBB == nullptr)
98+
return;
99+
auto It = SchedStates.find(SinglePredMBB);
100+
if (It == SchedStates.end())
99101
return;
100102

101103
LLVM_DEBUG(dbgs() << "** Continued scheduling from "
102104
<< printMBBReference(*SinglePredMBB) << "\n";);
103105

104-
HazardRec->copyState(SchedStates[SinglePredMBB]);
106+
HazardRec->copyState(It->second);
105107
LLVM_DEBUG(HazardRec->dumpState(););
106108

107109
// Emit incoming terminator(s). Be optimistic and assume that branch

0 commit comments

Comments
 (0)