Skip to content

Commit bcb0c3a

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (#129465)
1 parent bcce754 commit bcb0c3a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,10 +1359,9 @@ void VarLocBasedLDV::removeEntryValue(const MachineInstr &MI,
13591359
return;
13601360

13611361
// Try to get non-debug instruction responsible for the DBG_VALUE.
1362-
const MachineInstr *TransferInst = nullptr;
13631362
Register Reg = MI.getDebugOperand(0).getReg();
1364-
if (Reg.isValid() && RegSetInstrs.contains(Reg))
1365-
TransferInst = RegSetInstrs.find(Reg)->second;
1363+
const MachineInstr *TransferInst =
1364+
Reg.isValid() ? RegSetInstrs.lookup(Reg) : nullptr;
13661365

13671366
// Case of the parameter's DBG_VALUE at the start of entry MBB.
13681367
if (!TransferInst && !LastNonDbgMI && MI.getParent()->isEntryBlock())

0 commit comments

Comments
 (0)