From 7a015995e599432430472fe542a7eb614bc86b53 Mon Sep 17 00:00:00 2001 From: Kazu Hirata 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 55a0afcf7a33f..c9efec37b0bc6 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); } }