aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
index 2d45c42..f8790dd 100644
--- a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
+++ b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
@@ -2849,12 +2849,10 @@ ARMPreAllocLoadStoreOpt::RescheduleLoadStoreInstrs(MachineBasicBlock *MBB) {
// Erase the entry into the DbgValueSinkCandidates for the DBG_VALUE
// that was moved.
auto DbgVar = createDebugVariableFromMachineInstr(DbgInstr);
- auto DbgIt = DbgValueSinkCandidates.find(DbgVar);
- // If the instruction is a DBG_VALUE_LIST, it may have already been
- // erased from the DbgValueSinkCandidates. Only erase if it exists in
- // the DbgValueSinkCandidates.
- if (DbgIt != DbgValueSinkCandidates.end())
- DbgValueSinkCandidates.erase(DbgIt);
+ // Erase DbgVar from DbgValueSinkCandidates if still present. If the
+ // instruction is a DBG_VALUE_LIST, it may have already been erased from
+ // DbgValueSinkCandidates.
+ DbgValueSinkCandidates.erase(DbgVar);
// Zero out original dbg instr
forEachDbgRegOperand(DbgInstr,
[&](MachineOperand &Op) { Op.setReg(0); });