diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2022-04-06 11:50:51 +0100 |
---|---|---|
committer | Jeremy Morse <jeremy.morse@sony.com> | 2022-04-06 11:55:38 +0100 |
commit | fb6596f1ecab652b5b90cf2e395d64112504c1f8 (patch) | |
tree | b2e178b03419634acb3782d7aff857a15039cac3 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 77c74fd877b27418171693f187b8db865567b8dc (diff) | |
download | llvm-fb6596f1ecab652b5b90cf2e395d64112504c1f8.zip llvm-fb6596f1ecab652b5b90cf2e395d64112504c1f8.tar.gz llvm-fb6596f1ecab652b5b90cf2e395d64112504c1f8.tar.bz2 |
[DebugInfo][InstrRef] Avoid a crash from mixed variable location modes
Variable locations now come in two modes, instruction referencing and
DBG_VALUE. At -O0 we pick DBG_VALUE to allow fast construction of variable
information. Unfortunately, SelectionDAG edits the optimisation level in
the presence of opt-bisect-limit, meaning different passes have different
views of what variable location mode we should use. That causes assertions
when they're mixed.
This patch plumbs through a boolean in SelectionDAG from start to
instruction emission, so that we don't rely on the current optimisation
level for correctness.
Differential Revision: https://reviews.llvm.org/D123033
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index c2648a3..db91088 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -1166,9 +1166,6 @@ void MachineFunction::finalizeDebugInstrRefs() { MI.getOperand(1).ChangeToRegister(0, false); }; - if (!useDebugInstrRef()) - return; - for (auto &MBB : *this) { for (auto &MI : MBB) { if (!MI.isDebugRef() || !MI.getOperand(0).isReg()) |