diff options
author | Carlos Alberto Enciso <carlos.alberto.enciso@gmail.com> | 2018-08-30 07:17:41 +0000 |
---|---|---|
committer | Carlos Alberto Enciso <carlos.alberto.enciso@gmail.com> | 2018-08-30 07:17:41 +0000 |
commit | 06adfa17188859cab229fb977ec9dfe2b7dce6ed (patch) | |
tree | 9348bc5460adbdc996e97263c50285446b87998d /llvm/lib/CodeGen/MachineCSE.cpp | |
parent | 62f7a3207b2f1a78afc9dbbfe20f4327f7283020 (diff) | |
download | bcm5719-llvm-06adfa17188859cab229fb977ec9dfe2b7dce6ed.tar.gz bcm5719-llvm-06adfa17188859cab229fb977ec9dfe2b7dce6ed.zip |
[DWARF] Missing location debug information with -O2.
Check that Machine CSE correctly handles during the transformation, the
debug location information for local variables.
Differential Revision: https://reviews.llvm.org/D50887
llvm-svn: 341025
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineCSE.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp index 6c92b1d426d..fa785ac0c5a 100644 --- a/llvm/lib/CodeGen/MachineCSE.cpp +++ b/llvm/lib/CodeGen/MachineCSE.cpp @@ -180,6 +180,14 @@ bool MachineCSE::PerformTrivialCopyPropagation(MachineInstr *MI, continue; 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); + // Propagate SrcReg of copies to MI. MO.setReg(SrcReg); MRI->clearKillFlags(SrcReg); |