Skip to content

Commit 19a7fe0

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (#123894)
1 parent 8ad4f1a commit 19a7fe0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/CodeGen/MachineBlockPlacement.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3178,11 +3178,11 @@ bool MachineBlockPlacement::maybeTailDuplicateBlock(
31783178
// Conservative default.
31793179
bool InWorkList = true;
31803180
// Remove from the Chain and Chain Map
3181-
if (BlockToChain.count(RemBB)) {
3182-
BlockChain *Chain = BlockToChain[RemBB];
3181+
if (auto It = BlockToChain.find(RemBB); It != BlockToChain.end()) {
3182+
BlockChain *Chain = It->second;
31833183
InWorkList = Chain->UnscheduledPredecessors == 0;
31843184
Chain->remove(RemBB);
3185-
BlockToChain.erase(RemBB);
3185+
BlockToChain.erase(It);
31863186
}
31873187

31883188
// Handle the unplaced block iterator

0 commit comments

Comments
 (0)