[llvm] [AsmPrinter] Avoid repeated map lookups (NFC) (PR #126431)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 9 11:45:19 PST 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/126431
None
>From 7a015995e599432430472fe542a7eb614bc86b53 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 9 Feb 2025 09:12:10 -0800
Subject: [PATCH] [AsmPrinter] Avoid repeated map lookups (NFC)
---
llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
index 55a0afcf7a33f16..c9efec37b0bc679 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
@@ -414,9 +414,10 @@ static void handleNewDebugValue(InlinedEntity Var, const MachineInstr &DV,
dropRegDescribedVar(RegVars, I.first, Var);
// Drop all entries that have ended, and mark the new entry as live.
+ auto &Entries = LiveEntries[Var];
for (auto Index : IndicesToErase)
- LiveEntries[Var].erase(Index);
- LiveEntries[Var].insert(NewIndex);
+ Entries.erase(Index);
+ Entries.insert(NewIndex);
}
}
More information about the llvm-commits
mailing list