diff options
author | Carlos Alberto Enciso <carlos.alberto.enciso@gmail.com> | 2018-10-01 08:14:44 +0000 |
---|---|---|
committer | Carlos Alberto Enciso <carlos.alberto.enciso@gmail.com> | 2018-10-01 08:14:44 +0000 |
commit | 81d8ef219671241c1486ca08b07ec6e8b1b7531e (patch) | |
tree | 19ff3f9bf91854c19d360d1e1977b481862fbd8d /llvm/lib/CodeGen/MachineCSE.cpp | |
parent | ce4caff0de60e115974b05fcf240f294f9b7ff7f (diff) | |
download | llvm-81d8ef219671241c1486ca08b07ec6e8b1b7531e.zip llvm-81d8ef219671241c1486ca08b07ec6e8b1b7531e.tar.gz llvm-81d8ef219671241c1486ca08b07ec6e8b1b7531e.tar.bz2 |
[DebugInfo][Dexter] Incorrect DBG_VALUE after MCP dead copy instruction removal.
When MachineCopyPropagation eliminates a dead 'copy', its associated debug information becomes invalid. as the recorded register has been removed. It causes the debugger to display wrong variable value.
Differential Revision: https://reviews.llvm.org/D52614
llvm-svn: 343445
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineCSE.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp index fa785ac..dcb6f7c 100644 --- a/llvm/lib/CodeGen/MachineCSE.cpp +++ b/llvm/lib/CodeGen/MachineCSE.cpp @@ -181,12 +181,8 @@ bool MachineCSE::PerformTrivialCopyPropagation(MachineInstr *MI, LLVM_DEBUG(dbgs() << "Coalescing: " << *DefMI); LLVM_DEBUG(dbgs() << "*** to: " << *MI); - // Collect matching debug values. - SmallVector<MachineInstr *, 2> DbgValues; - DefMI->collectDebugValues(DbgValues); - // Propagate SrcReg to debug value instructions. - for (auto *DBI : DbgValues) - DBI->getOperand(0).setReg(SrcReg); + // Update matching debug values. + DefMI->changeDebugValuesDefReg(SrcReg); // Propagate SrcReg of copies to MI. MO.setReg(SrcReg); |