diff options
author | Kazu Hirata <kazu@google.com> | 2025-03-08 01:02:47 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-08 01:02:47 -0800 |
commit | 49cf69a46b0527eaa7ac2eb1f4be898dd99727ba (patch) | |
tree | d25def08d448ca8c8217cddf8ec24e8cf165aa0e /llvm/lib | |
parent | 3e0c503e3e259ce63b08e5d780a82fe7385dfbc8 (diff) | |
download | llvm-49cf69a46b0527eaa7ac2eb1f4be898dd99727ba.zip llvm-49cf69a46b0527eaa7ac2eb1f4be898dd99727ba.tar.gz llvm-49cf69a46b0527eaa7ac2eb1f4be898dd99727ba.tar.bz2 |
[SystemZ] Avoid repeated hash lookups (NFC) (#130392)
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZMachineScheduler.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZMachineScheduler.cpp b/llvm/lib/Target/SystemZ/SystemZMachineScheduler.cpp index 4bc979de..5e2365f 100644 --- a/llvm/lib/Target/SystemZ/SystemZMachineScheduler.cpp +++ b/llvm/lib/Target/SystemZ/SystemZMachineScheduler.cpp @@ -94,14 +94,16 @@ void SystemZPostRASchedStrategy::enterMBB(MachineBasicBlock *NextMBB) { // scheduled. If this is not possible, we are done. MachineBasicBlock *SinglePredMBB = getSingleSchedPred(MBB, MLI->getLoopFor(MBB)); - if (SinglePredMBB == nullptr || - SchedStates.find(SinglePredMBB) == SchedStates.end()) + if (SinglePredMBB == nullptr) + return; + auto It = SchedStates.find(SinglePredMBB); + if (It == SchedStates.end()) return; LLVM_DEBUG(dbgs() << "** Continued scheduling from " << printMBBReference(*SinglePredMBB) << "\n";); - HazardRec->copyState(SchedStates[SinglePredMBB]); + HazardRec->copyState(It->second); LLVM_DEBUG(HazardRec->dumpState();); // Emit incoming terminator(s). Be optimistic and assume that branch |