summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-02-02 06:41:55 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-02-02 06:41:55 +0000
commitccc809e2e60fbcf519b3945bc33e92b9093405f1 (patch)
treeb8c36db9581c8698fad43cea483321b486279493 /llvm/lib/CodeGen
parent343f7e5d8dd56180084023b9846d18e97e62ebbf (diff)
downloadbcm5719-llvm-ccc809e2e60fbcf519b3945bc33e92b9093405f1.tar.gz
bcm5719-llvm-ccc809e2e60fbcf519b3945bc33e92b9093405f1.zip
[RegisterCoalescer] Better DebugLoc for reMaterializeTrivialDef
When rematerializing a computation by replacing the copy, use the copy's location. The location of the copy is more representative of the original program. This partially fixes PR10003. llvm-svn: 259469
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/RegisterCoalescer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index c1ff13ec7ca..95c772357c3 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -939,11 +939,13 @@ bool RegisterCoalescer::reMaterializeTrivialDef(const CoalescerPair &CP,
}
}
+ DebugLoc DL = CopyMI->getDebugLoc();
MachineBasicBlock *MBB = CopyMI->getParent();
MachineBasicBlock::iterator MII =
std::next(MachineBasicBlock::iterator(CopyMI));
TII->reMaterialize(*MBB, MII, DstReg, SrcIdx, DefMI, *TRI);
MachineInstr *NewMI = std::prev(MII);
+ NewMI->setDebugLoc(DL);
// In a situation like the following:
// %vreg0:subreg = instr ; DefMI, subreg = DstIdx
OpenPOWER on IntegriCloud