aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-03-03 07:27:16 -0800
committerGitHub <noreply@github.com>2025-03-03 07:27:16 -0800
commitbcb0c3a2917156e313dc5258fce0890a951ebabf (patch)
tree3a5429139b35e4e048e8032eee97098dd0084f2b /llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
parentbcce75415e52c8529e94f70c49b481e903381aaa (diff)
downloadllvm-bcb0c3a2917156e313dc5258fce0890a951ebabf.zip
llvm-bcb0c3a2917156e313dc5258fce0890a951ebabf.tar.gz
llvm-bcb0c3a2917156e313dc5258fce0890a951ebabf.tar.bz2
[CodeGen] Avoid repeated hash lookups (NFC) (#129465)
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
index 94e7f1b..f7150f9 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
@@ -1359,10 +1359,9 @@ void VarLocBasedLDV::removeEntryValue(const MachineInstr &MI,
return;
// Try to get non-debug instruction responsible for the DBG_VALUE.
- const MachineInstr *TransferInst = nullptr;
Register Reg = MI.getDebugOperand(0).getReg();
- if (Reg.isValid() && RegSetInstrs.contains(Reg))
- TransferInst = RegSetInstrs.find(Reg)->second;
+ const MachineInstr *TransferInst =
+ Reg.isValid() ? RegSetInstrs.lookup(Reg) : nullptr;
// Case of the parameter's DBG_VALUE at the start of entry MBB.
if (!TransferInst && !LastNonDbgMI && MI.getParent()->isEntryBlock())