summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-12-04 22:29:04 +0000
committerAdrian Prantl <aprantl@apple.com>2014-12-04 22:29:04 +0000
commita3ae0b3b5bea9fc6d64269792d608ea9ff104164 (patch)
tree0121f6d5670a1c11a58a019671a3819bfc4d2053 /llvm/lib/CodeGen
parente9a36eab1edaf5debce77a773877240a223ef77c (diff)
downloadbcm5719-llvm-a3ae0b3b5bea9fc6d64269792d608ea9ff104164.tar.gz
bcm5719-llvm-a3ae0b3b5bea9fc6d64269792d608ea9ff104164.zip
Debug info: If the RegisterCoalescer::reMaterializeTrivialDef() is
eliminating all uses of a vreg, update any DBG_VALUE describing that vreg to point to the rematerialized register instead. llvm-svn: 223401
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/RegisterCoalescer.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index 2d2dc92a56b..0596b60a19a 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -898,8 +898,20 @@ bool RegisterCoalescer::reMaterializeTrivialDef(CoalescerPair &CP,
// The source interval can become smaller because we removed a use.
LIS->shrinkToUses(&SrcInt, &DeadDefs);
- if (!DeadDefs.empty())
+ if (!DeadDefs.empty()) {
+ // If the virtual SrcReg is completely eliminated, update all DBG_VALUEs
+ // to describe DstReg instead.
+ for (MachineRegisterInfo::use_iterator UI = MRI->use_begin(SrcReg),
+ UE = MRI->use_end(); UI != UE; ++UI) {
+ MachineOperand &UseMO = *UI;
+ MachineInstr *UseMI = UseMO.getParent();
+ if (UseMI->isDebugValue()) {
+ UseMO.setReg(DstReg);
+ DEBUG({dbgs() << "\t\tupdated: " << *UseMI;});
+ }
+ }
eliminateDeadDefs();
+ }
return true;
}
OpenPOWER on IntegriCloud