summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LiveInterval.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp
index 83dd982587c..2340b6abd87 100644
--- a/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/llvm/lib/CodeGen/LiveInterval.cpp
@@ -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)
OpenPOWER on IntegriCloud