From f551fb96c7fbe38628f049bfe0e48a6943ee341f Mon Sep 17 00:00:00 2001 From: Jeremy Morse Date: Fri, 9 Jul 2021 15:32:30 +0100 Subject: [Debug-info][InstrRef] Avoid an unnecessary map ordering We keep a record of substitutions between debug value numbers post-isel, however we never actually look them up until the end of compilation. As a result, there's nothing gained by the collection being a std::map. This patch downgrades it to being a vector, that's then sorted at the end of compilation in LiveDebugValues. Differential Revision: https://reviews.llvm.org/D105029 --- llvm/lib/CodeGen/MachineFunction.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 7cb7d089..d26f581 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -973,9 +973,7 @@ void MachineFunction::makeDebugValueSubstitution(DebugInstrOperandPair A, unsigned Subreg) { // Catch any accidental self-loops. assert(A.first != B.first); - auto Result = DebugValueSubstitutions.insert({A, {B, Subreg}}); - (void)Result; - assert(Result.second && "Substitution for an already substituted value?"); + DebugValueSubstitutions.push_back({A, B, Subreg}); } void MachineFunction::substituteDebugValuesForInst(const MachineInstr &Old, -- cgit v1.1