summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-05-23 17:02:23 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-05-23 17:02:23 +0000
commit43711c51ec91676899b9873c67f4bc69e474e7f7 (patch)
treeac16a5d2f62a0d49074cfd6e46f4e07dceb32cf0 /llvm/lib
parentad5c24f1617d012d9b0a678094ea554104dd3e7a (diff)
downloadbcm5719-llvm-43711c51ec91676899b9873c67f4bc69e474e7f7.tar.gz
bcm5719-llvm-43711c51ec91676899b9873c67f4bc69e474e7f7.zip
Fix PR16110: Handle DBG_VALUE in ConnectedVNInfoEqClasses::Distribute().
Now that the LiveDebugVariables pass is running *after* register coalescing, the ConnectedVNInfoEqClasses class needs to deal with DBG_VALUE instructions. This only comes up when rematerialization during coalescing causes the remaining live range of a virtual register to separate into two connected components. llvm-svn: 182592
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LiveInterval.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp
index dccd847d070..861e99b785d 100644
--- a/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/llvm/lib/CodeGen/LiveInterval.cpp
@@ -909,8 +909,16 @@ void ConnectedVNInfoEqClasses::Distribute(LiveInterval *LIV[],
MachineOperand &MO = RI.getOperand();
MachineInstr *MI = MO.getParent();
++RI;
- // DBG_VALUE instructions should have been eliminated earlier.
- LiveRangeQuery LRQ(LI, LIS.getInstructionIndex(MI));
+ // DBG_VALUE instructions don't have slot indexes, so get the index of the
+ // instruction before them.
+ // Normally, DBG_VALUE instructions are removed before this function is
+ // called, but it is not a requirement.
+ SlotIndex Idx;
+ if (MI->isDebugValue())
+ Idx = LIS.getSlotIndexes()->getIndexBefore(MI);
+ else
+ Idx = LIS.getInstructionIndex(MI);
+ LiveRangeQuery LRQ(LI, Idx);
const VNInfo *VNI = MO.readsReg() ? LRQ.valueIn() : LRQ.valueDefined();
// In the case of an <undef> use that isn't tied to any def, VNI will be
// NULL. If the use is tied to a def, VNI will be the defined value.
OpenPOWER on IntegriCloud