diff options
author | Matthias Braun <matze@braunis.de> | 2018-09-19 00:23:35 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2018-09-19 00:23:35 +0000 |
commit | 726e12cf0ce6c926877bd8e19e6afe05e5101eeb (patch) | |
tree | 3c51890e89c9edc54677dd95cf3939a1b50b6e8c /llvm/lib/CodeGen/PostRASchedulerList.cpp | |
parent | f6ccde781004295dc031b86ee1f19a367130db70 (diff) | |
download | llvm-726e12cf0ce6c926877bd8e19e6afe05e5101eeb.zip llvm-726e12cf0ce6c926877bd8e19e6afe05e5101eeb.tar.gz llvm-726e12cf0ce6c926877bd8e19e6afe05e5101eeb.tar.bz2 |
ScheduleDAG: Cleanup dumping code; NFC
- Instead of having both `SUnit::dump(ScheduleDAG*)` and
`ScheduleDAG::dumpNode(ScheduleDAG*)`, just keep the latter around.
- Add `ScheduleDAG::dump()` and avoid code duplication in several
places. Implement it for different ScheduleDAG variants.
- Add `ScheduleDAG::dumpNodeName()` in favor of the `SUnit::print()`
functions. They were only ever used for debug dumping and putting the
function into ScheduleDAG is consistent with the `dumpNode()` change.
llvm-svn: 342520
Diffstat (limited to 'llvm/lib/CodeGen/PostRASchedulerList.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PostRASchedulerList.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/PostRASchedulerList.cpp b/llvm/lib/CodeGen/PostRASchedulerList.cpp index 215da63..dd0a5fe 100644 --- a/llvm/lib/CodeGen/PostRASchedulerList.cpp +++ b/llvm/lib/CodeGen/PostRASchedulerList.cpp @@ -256,7 +256,7 @@ void SchedulePostRATDList::exitRegion() { LLVM_DUMP_METHOD void SchedulePostRATDList::dumpSchedule() const { for (unsigned i = 0, e = Sequence.size(); i != e; i++) { if (SUnit *SU = Sequence[i]) - SU->dump(this); + dumpNode(*SU); else dbgs() << "**** NOOP ****\n"; } @@ -414,11 +414,7 @@ void SchedulePostRATDList::schedule() { postprocessDAG(); LLVM_DEBUG(dbgs() << "********** List Scheduling **********\n"); - LLVM_DEBUG(for (const SUnit &SU - : SUnits) { - SU.dumpAll(this); - dbgs() << '\n'; - }); + LLVM_DEBUG(dump()); AvailableQueue.initNodes(SUnits); ListScheduleTopDown(); @@ -465,7 +461,7 @@ void SchedulePostRATDList::ReleaseSucc(SUnit *SU, SDep *SuccEdge) { #ifndef NDEBUG if (SuccSU->NumPredsLeft == 0) { dbgs() << "*** Scheduling failed! ***\n"; - SuccSU->dump(this); + dumpNode(*SuccSU); dbgs() << " has been released too many times!\n"; llvm_unreachable(nullptr); } @@ -502,7 +498,7 @@ void SchedulePostRATDList::ReleaseSuccessors(SUnit *SU) { /// the Available queue. void SchedulePostRATDList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) { LLVM_DEBUG(dbgs() << "*** Scheduling [" << CurCycle << "]: "); - LLVM_DEBUG(SU->dump(this)); + LLVM_DEBUG(dumpNode(*SU)); Sequence.push_back(SU); assert(CurCycle >= SU->getDepth() && |