summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2021-08-20 14:48:45 +0100
committerJeremy Morse <jeremy.morse@sony.com>2021-08-20 14:51:02 +0100
commitce8254d096baf81609da2dd0e3dd7ea3387f6aa0 (patch)
treef4d827af4ed5b79745fafcc89caf0ee958105703 /llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
parent48f73ee666a264d23716ff6bb671cad836b65ccf (diff)
[DebugInfo][InstrRef] Correctly ignore DBG_VALUE_LIST in InstrRef mode
This patch makes InstrRefBasedLDV "safe" to work with DBG_VALUE_LISTs. It doesn't actually interpret them, but it recognises that they specify variable locations and avoids propagating false locations, which is better than the current state. Observe the attached tes * We avoid propagating DBG_VALUE_LISTs into successor blocks, as they're not "currently" supported, * We don't propagate other variable locations across DBG_VALUE_LISTs, because we know that the variable location is terminated by the DBG_VALUE_LIST. Differential Revision: https://reviews.llvm.org/D108143
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index 5c1bbf724eb9..233824f1ed75 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -1759,6 +1759,17 @@ bool InstrRefBasedLDV::transferDebugValue(const MachineInstr &MI) {
if (Scope == nullptr)
return true; // handled it; by doing nothing
+ // For now, ignore DBG_VALUE_LISTs when extending ranges. Allow it to
+ // contribute to locations in this block, but don't propagate further.
+ // Interpret it like a DBG_VALUE $noreg.
+ if (MI.isDebugValueList()) {
+ if (VTracker)
+ VTracker->defVar(MI, Properties, None);
+ if (TTracker)
+ TTracker->redefVar(MI, Properties, None);
+ return true;
+ }
+
const MachineOperand &MO = MI.getOperand(0);
// MLocTracker needs to know that this register is read, even if it's only