diff options
author | Alexey Lapshin <a.v.lapshin@mail.ru> | 2019-06-06 21:19:39 +0000 |
---|---|---|
committer | Alexey Lapshin <a.v.lapshin@mail.ru> | 2019-06-06 21:19:39 +0000 |
commit | b9f1e7b16ed2341e54b4e2033d111e7a2ca19b9a (patch) | |
tree | 6385b1d5e0caa713d4a1c13612b873ff12392834 /llvm/lib/CodeGen | |
parent | 37bd9bd13750a368c0468f0768f29edc37dc540a (diff) | |
download | bcm5719-llvm-b9f1e7b16ed2341e54b4e2033d111e7a2ca19b9a.tar.gz bcm5719-llvm-b9f1e7b16ed2341e54b4e2033d111e7a2ca19b9a.zip |
[DebugInfo] Incorrect debug info record generated for loop counter.
Incorrect Debug Variable Range was calculated while "COMPUTING LIVE DEBUG VARIABLES" stage.
Range for Debug Variable("i") computed according to current state of instructions
inside of basic block. But Register Allocator creates new instructions which were not taken
into account when Live Debug Variables computed. In the result DBG_VALUE instruction for
the "i" variable was put after these newly inserted instructions. This is incorrect.
Debug Value for the loop counter should be inserted before any loop instruction.
Differential Revision: https://reviews.llvm.org/D62650
llvm-svn: 362750
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index c3503bd9980..4256edeedd3 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -167,10 +167,6 @@ class UserValue { /// Map of slot indices where this value is live. LocMap locInts; - /// Set of interval start indexes that have been trimmed to the - /// lexical scope. - SmallSet<SlotIndex, 2> trimmedDefs; - /// Insert a DBG_VALUE into MBB at Idx for LocNo. void insertDebugValue(MachineBasicBlock *MBB, SlotIndex StartIdx, SlotIndex StopIdx, DbgValueLocation Loc, bool Spilled, @@ -915,8 +911,7 @@ void UserValue::computeIntervals(MachineRegisterInfo &MRI, ++I; // If the interval also overlaps the start of the "next" (i.e. - // current) range create a new interval for the remainder (which - // may be further trimmed). + // current) range create a new interval for the remainder if (RStart < IStop) I.insert(RStart, IStop, Loc); } @@ -926,13 +921,6 @@ void UserValue::computeIntervals(MachineRegisterInfo &MRI, if (!I.valid()) return; - if (I.start() < RStart) { - // Interval start overlaps range - trim to the scope range. - I.setStartUnchecked(RStart); - // Remember that this interval was trimmed. - trimmedDefs.insert(RStart); - } - // The end of a lexical scope range is the last instruction in the // range. To convert to an interval we need the index of the // instruction after it. @@ -1362,12 +1350,6 @@ void UserValue::emitDebugValues(VirtRegMap *VRM, LiveIntervals &LIS, bool Spilled = SpillIt != SpillOffsets.end(); unsigned SpillOffset = Spilled ? SpillIt->second : 0; - // If the interval start was trimmed to the lexical scope insert the - // DBG_VALUE at the previous index (otherwise it appears after the - // first instruction in the range). - if (trimmedDefs.count(Start)) - Start = Start.getPrevIndex(); - LLVM_DEBUG(dbgs() << "\t[" << Start << ';' << Stop << "):" << Loc.locNo()); MachineFunction::iterator MBB = LIS.getMBBFromIndex(Start)->getIterator(); SlotIndex MBBEnd = LIS.getMBBEndIdx(&*MBB); |