Skip to content

Commit

Permalink
[LiveDebugValues] Avoid repeated hash lookups (NFC) (#108484)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored Sep 13, 2024
1 parent 0351dc5 commit 3a27458
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2231,11 +2231,9 @@ void InstrRefBasedLDV::accumulateFragmentMap(MachineInstr &MI) {
// If this is the first sighting of this variable, then we are guaranteed
// there are currently no overlapping fragments either. Initialize the set
// of seen fragments, record no overlaps for the current one, and return.
auto SeenIt = SeenFragments.find(MIVar.getVariable());
if (SeenIt == SeenFragments.end()) {
SmallSet<FragmentInfo, 4> OneFragment;
OneFragment.insert(ThisFragment);
SeenFragments.insert({MIVar.getVariable(), OneFragment});
auto [SeenIt, Inserted] = SeenFragments.try_emplace(MIVar.getVariable());
if (Inserted) {
SeenIt->second.insert(ThisFragment);

OverlapFragments.insert({{MIVar.getVariable(), ThisFragment}, {}});
return;
Expand Down

0 comments on commit 3a27458

Please sign in to comment.