Update DBG_VALUE register operand during LiveInterval operations

Summary:
Handling of DBG_VALUE in ConnectedVNInfoEqClasses::Distribute() was fixed in
PR16110. However DBG_VALUE register operands are not getting updated. This
patch properly resolves the value location.

Reviewers: MatzeB, vsk

Reviewed By: MatzeB

Subscribers: kparzysz, thegameg, vsk, MatzeB, dschuff, sbc100, jgravelle-google, aheejin, sunfish, llvm-commits

Tags: #debug-info

Differential Revision: https://reviews.llvm.org/D48994

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340310 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Yury Delendik
2018-08-21 17:48:28 +00:00
parent 43485c4468
commit 985ee9ed76
2 changed files with 121 additions and 11 deletions
+11 -11
View File
@@ -1310,17 +1310,17 @@ void ConnectedVNInfoEqClasses::Distribute(LiveInterval &LI, LiveInterval *LIV[],
MachineOperand &MO = *RI;
MachineInstr *MI = RI->getParent();
++RI;
// 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);
LiveQueryResult LRQ = LI.Query(Idx);
const VNInfo *VNI = MO.readsReg() ? LRQ.valueIn() : LRQ.valueDefined();
const VNInfo *VNI;
if (MI->isDebugValue()) {
// DBG_VALUE instructions don't have slot indexes, so get the index of
// the instruction before them. The value is defined there too.
SlotIndex Idx = LIS.getSlotIndexes()->getIndexBefore(*MI);
VNI = LI.Query(Idx).valueOut();
} else {
SlotIndex Idx = LIS.getInstructionIndex(*MI);
LiveQueryResult LRQ = LI.Query(Idx);
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.
if (!VNI)