summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineSink.cpp
diff options
context:
space:
mode:
authorCarlos Alberto Enciso <carlos.alberto.enciso@gmail.com>2018-08-30 07:17:41 +0000
committerCarlos Alberto Enciso <carlos.alberto.enciso@gmail.com>2018-08-30 07:17:41 +0000
commit06adfa17188859cab229fb977ec9dfe2b7dce6ed (patch)
tree9348bc5460adbdc996e97263c50285446b87998d /llvm/lib/CodeGen/MachineSink.cpp
parent62f7a3207b2f1a78afc9dbbfe20f4327f7283020 (diff)
downloadbcm5719-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/MachineSink.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineSink.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp
index 1fd40f75735..d52e6198d4e 100644
--- a/llvm/lib/CodeGen/MachineSink.cpp
+++ b/llvm/lib/CodeGen/MachineSink.cpp
@@ -513,25 +513,6 @@ bool MachineSinking::PostponeSplitCriticalEdge(MachineInstr &MI,
return true;
}
-/// collectDebgValues - Scan instructions following MI and collect any
-/// matching DBG_VALUEs.
-static void collectDebugValues(MachineInstr &MI,
- SmallVectorImpl<MachineInstr *> &DbgValues) {
- DbgValues.clear();
- if (!MI.getOperand(0).isReg())
- return;
-
- MachineBasicBlock::iterator DI = MI; ++DI;
- for (MachineBasicBlock::iterator DE = MI.getParent()->end();
- DI != DE; ++DI) {
- if (!DI->isDebugValue())
- return;
- if (DI->getOperand(0).isReg() &&
- DI->getOperand(0).getReg() == MI.getOperand(0).getReg())
- DbgValues.push_back(&*DI);
- }
-}
-
/// isProfitableToSinkTo - Return true if it is profitable to sink MI.
bool MachineSinking::isProfitableToSinkTo(unsigned Reg, MachineInstr &MI,
MachineBasicBlock *MBB,
@@ -758,7 +739,7 @@ static void performSink(MachineInstr &MI, MachineBasicBlock &SuccToSinkTo,
MachineBasicBlock::iterator InsertPos) {
// Collect matching debug values.
SmallVector<MachineInstr *, 2> DbgValuesToSink;
- collectDebugValues(MI, DbgValuesToSink);
+ MI.collectDebugValues(DbgValuesToSink);
// If we cannot find a location to use (merge with), then we erase the debug
// location to prevent debug-info driven tools from potentially reporting
OpenPOWER on IntegriCloud