Skip to content

Commit 44b9f5e

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (#129190)
1 parent f4aea13 commit 44b9f5e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,12 @@ class MemLocFragmentFill {
600600
break;
601601
}
602602

603-
auto CurrentLiveInEntry = LiveIn.find(&BB);
604603
// If there's no LiveIn entry for the block yet, add it.
605-
if (CurrentLiveInEntry == LiveIn.end()) {
604+
auto [CurrentLiveInEntry, Inserted] = LiveIn.try_emplace(&BB);
605+
if (Inserted) {
606606
LLVM_DEBUG(dbgs() << "change=true (first) on meet on " << BB.getName()
607607
<< "\n");
608-
LiveIn[&BB] = std::move(BBLiveIn);
608+
CurrentLiveInEntry->second = std::move(BBLiveIn);
609609
return /*Changed=*/true;
610610
}
611611

0 commit comments

Comments
 (0)