aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-02-27 23:01:35 -0800
committerGitHub <noreply@github.com>2025-02-27 23:01:35 -0800
commit44b9f5eeab63dbf7d4e4ebc87dfedca5c42708b6 (patch)
tree202d99f95271c5304c8c9208e3eec15dc8e10161 /llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
parentf4aea1324d78778e86541ffc64859154cc9064d9 (diff)
downloadllvm-44b9f5eeab63dbf7d4e4ebc87dfedca5c42708b6.zip
llvm-44b9f5eeab63dbf7d4e4ebc87dfedca5c42708b6.tar.gz
llvm-44b9f5eeab63dbf7d4e4ebc87dfedca5c42708b6.tar.bz2
[CodeGen] Avoid repeated hash lookups (NFC) (#129190)
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
index dbc7246..8d91e71 100644
--- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
+++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
@@ -600,12 +600,12 @@ class MemLocFragmentFill {
break;
}
- auto CurrentLiveInEntry = LiveIn.find(&BB);
// If there's no LiveIn entry for the block yet, add it.
- if (CurrentLiveInEntry == LiveIn.end()) {
+ auto [CurrentLiveInEntry, Inserted] = LiveIn.try_emplace(&BB);
+ if (Inserted) {
LLVM_DEBUG(dbgs() << "change=true (first) on meet on " << BB.getName()
<< "\n");
- LiveIn[&BB] = std::move(BBLiveIn);
+ CurrentLiveInEntry->second = std::move(BBLiveIn);
return /*Changed=*/true;
}