diff options
author | Kazu Hirata <kazu@google.com> | 2025-02-27 23:01:35 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-27 23:01:35 -0800 |
commit | 44b9f5eeab63dbf7d4e4ebc87dfedca5c42708b6 (patch) | |
tree | 202d99f95271c5304c8c9208e3eec15dc8e10161 /llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | |
parent | f4aea1324d78778e86541ffc64859154cc9064d9 (diff) | |
download | llvm-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.cpp | 6 |
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; } |