mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 21:30:49 +00:00
misched: try (not too hard) to place debug values where they belong
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155458 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
eb45ebbdef
commit
000b2504ee
@ -359,6 +359,8 @@ protected:
|
||||
void releaseSuccessors(SUnit *SU);
|
||||
void releasePred(SUnit *SU, SDep *PredEdge);
|
||||
void releasePredecessors(SUnit *SU);
|
||||
|
||||
void placeDebugValues();
|
||||
};
|
||||
} // namespace
|
||||
|
||||
@ -526,6 +528,29 @@ void ScheduleDAGMI::schedule() {
|
||||
SU->isScheduled = true;
|
||||
}
|
||||
assert(CurrentTop == CurrentBottom && "Nonempty unscheduled zone.");
|
||||
|
||||
placeDebugValues();
|
||||
}
|
||||
|
||||
/// Reinsert any remaining debug_values, just like the PostRA scheduler.
|
||||
void ScheduleDAGMI::placeDebugValues() {
|
||||
// If first instruction was a DBG_VALUE then put it back.
|
||||
if (FirstDbgValue) {
|
||||
BB->splice(RegionBegin, BB, FirstDbgValue);
|
||||
RegionBegin = FirstDbgValue;
|
||||
}
|
||||
|
||||
for (std::vector<std::pair<MachineInstr *, MachineInstr *> >::iterator
|
||||
DI = DbgValues.end(), DE = DbgValues.begin(); DI != DE; --DI) {
|
||||
std::pair<MachineInstr *, MachineInstr *> P = *prior(DI);
|
||||
MachineInstr *DbgValue = P.first;
|
||||
MachineBasicBlock::iterator OrigPrevMI = P.second;
|
||||
BB->splice(++OrigPrevMI, BB, DbgValue);
|
||||
if (OrigPrevMI == llvm::prior(RegionEnd))
|
||||
RegionEnd = DbgValue;
|
||||
}
|
||||
DbgValues.clear();
|
||||
FirstDbgValue = NULL;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
Reference in New Issue
Block a user