class MachineRegisterInfo;
class MachineInstr;
class TargetRegisterInfo;
+ class ScheduleDAG;
class SelectionDAG;
class SelectionDAGISel;
class TargetInstrInfo;
return false;
}
- void dump(const SelectionDAG *G) const;
- void dumpAll(const SelectionDAG *G) const;
+ void dump(const ScheduleDAG *G) const;
+ void dumpAll(const ScheduleDAG *G) const;
};
//===--------------------------------------------------------------------===//
void ScheduleDAG::dumpSchedule() const {
for (unsigned i = 0, e = Sequence.size(); i != e; i++) {
if (SUnit *SU = Sequence[i])
- SU->dump(DAG);
+ SU->dump(this);
else
cerr << "**** NOOP ****\n";
}
/// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
/// a group of nodes flagged together.
-void SUnit::dump(const SelectionDAG *G) const {
+void SUnit::dump(const ScheduleDAG *G) const {
cerr << "SU(" << NodeNum << "): ";
if (getNode())
- getNode()->dump(G);
+ getNode()->dump(G->DAG);
else
cerr << "CROSS RC COPY ";
cerr << "\n";
FlaggedNodes.push_back(N);
while (!FlaggedNodes.empty()) {
cerr << " ";
- FlaggedNodes.back()->dump(G);
+ FlaggedNodes.back()->dump(G->DAG);
cerr << "\n";
FlaggedNodes.pop_back();
}
}
-void SUnit::dumpAll(const SelectionDAG *G) const {
+void SUnit::dumpAll(const ScheduleDAG *G) const {
dump(G);
cerr << " # preds left : " << NumPredsLeft << "\n";
BuildSchedUnits();
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
- SUnits[su].dumpAll(DAG));
+ SUnits[su].dumpAll(this));
// Execute the actual scheduling loop.
ListScheduleBottomUp();
#ifndef NDEBUG
if (PredSU->NumSuccsLeft < 0) {
cerr << "*** Scheduling failed! ***\n";
- PredSU->dump(DAG);
+ PredSU->dump(this);
cerr << " has been released too many times!\n";
assert(0);
}
/// the Available queue.
void ScheduleDAGFast::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) {
DOUT << "*** Scheduling [" << CurCycle << "]: ";
- DEBUG(SU->dump(DAG));
+ DEBUG(SU->dump(this));
SU->Cycle = CurCycle;
// Bottom up: release predecessors
}
if (!AnyNotSched)
cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(DAG);
+ SUnits[i].dump(this);
cerr << "has not been scheduled!\n";
AnyNotSched = true;
}
if (SUnits[i].NumSuccsLeft != 0) {
if (!AnyNotSched)
cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(DAG);
+ SUnits[i].dump(this);
cerr << "has successors left!\n";
AnyNotSched = true;
}
#ifndef NDEBUG
if (SuccSU->NumPredsLeft < 0) {
cerr << "*** Scheduling failed! ***\n";
- SuccSU->dump(DAG);
+ SuccSU->dump(this);
cerr << " has been released too many times!\n";
assert(0);
}
/// the Available queue.
void ScheduleDAGList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
DOUT << "*** Scheduling [" << CurCycle << "]: ";
- DEBUG(SU->dump(DAG));
+ DEBUG(SU->dump(this));
Sequence.push_back(SU);
SU->Cycle = CurCycle;
if (SUnits[i].NumPredsLeft != 0) {
if (!AnyNotSched)
cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(DAG);
+ SUnits[i].dump(this);
cerr << "has not been scheduled!\n";
AnyNotSched = true;
}
BuildSchedUnits();
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
- SUnits[su].dumpAll(DAG));
+ SUnits[su].dumpAll(this));
if (!Fast) {
CalculateDepths();
CalculateHeights();
#ifndef NDEBUG
if (PredSU->NumSuccsLeft < 0) {
cerr << "*** Scheduling failed! ***\n";
- PredSU->dump(DAG);
+ PredSU->dump(this);
cerr << " has been released too many times!\n";
assert(0);
}
/// the Available queue.
void ScheduleDAGRRList::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) {
DOUT << "*** Scheduling [" << CurCycle << "]: ";
- DEBUG(SU->dump(DAG));
+ DEBUG(SU->dump(this));
SU->Cycle = CurCycle;
AvailableQueue->ScheduledNode(SU);
/// its predecessor states to reflect the change.
void ScheduleDAGRRList::UnscheduleNodeBottomUp(SUnit *SU) {
DOUT << "*** Unscheduling [" << SU->Cycle << "]: ";
- DEBUG(SU->dump(DAG));
+ DEBUG(SU->dump(this));
AvailableQueue->UnscheduledNode(SU);
}
if (!AnyNotSched)
cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(DAG);
+ SUnits[i].dump(this);
cerr << "has not been scheduled!\n";
AnyNotSched = true;
}
if (SUnits[i].NumSuccsLeft != 0) {
if (!AnyNotSched)
cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(DAG);
+ SUnits[i].dump(this);
cerr << "has successors left!\n";
AnyNotSched = true;
}
#ifndef NDEBUG
if (SuccSU->NumPredsLeft < 0) {
cerr << "*** Scheduling failed! ***\n";
- SuccSU->dump(DAG);
+ SuccSU->dump(this);
cerr << " has been released too many times!\n";
assert(0);
}
/// the Available queue.
void ScheduleDAGRRList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
DOUT << "*** Scheduling [" << CurCycle << "]: ";
- DEBUG(SU->dump(DAG));
+ DEBUG(SU->dump(this));
SU->Cycle = CurCycle;
Sequence.push_back(SU);
}
if (!AnyNotSched)
cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(DAG);
+ SUnits[i].dump(this);
cerr << "has not been scheduled!\n";
AnyNotSched = true;
}
if (SUnits[i].NumPredsLeft != 0) {
if (!AnyNotSched)
cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(DAG);
+ SUnits[i].dump(this);
cerr << "has predecessors left!\n";
AnyNotSched = true;
}