mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-15 23:57:48 +00:00
misched: try (not too hard) to place debug values where they belong
llvm-svn: 155458
This commit is contained in:
parent
02daf554b7
commit
0b0b66833e
@ -359,6 +359,8 @@ protected:
|
|||||||
void releaseSuccessors(SUnit *SU);
|
void releaseSuccessors(SUnit *SU);
|
||||||
void releasePred(SUnit *SU, SDep *PredEdge);
|
void releasePred(SUnit *SU, SDep *PredEdge);
|
||||||
void releasePredecessors(SUnit *SU);
|
void releasePredecessors(SUnit *SU);
|
||||||
|
|
||||||
|
void placeDebugValues();
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
@ -526,6 +528,29 @@ void ScheduleDAGMI::schedule() {
|
|||||||
SU->isScheduled = true;
|
SU->isScheduled = true;
|
||||||
}
|
}
|
||||||
assert(CurrentTop == CurrentBottom && "Nonempty unscheduled zone.");
|
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