mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
Change SUnit's dump method to take a ScheduleDAG* instead of
a SelectionDAG*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59488 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -29,6 +29,7 @@ namespace llvm {
|
|||||||
class MachineRegisterInfo;
|
class MachineRegisterInfo;
|
||||||
class MachineInstr;
|
class MachineInstr;
|
||||||
class TargetRegisterInfo;
|
class TargetRegisterInfo;
|
||||||
|
class ScheduleDAG;
|
||||||
class SelectionDAG;
|
class SelectionDAG;
|
||||||
class SelectionDAGISel;
|
class SelectionDAGISel;
|
||||||
class TargetInstrInfo;
|
class TargetInstrInfo;
|
||||||
@ -239,8 +240,8 @@ namespace llvm {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump(const SelectionDAG *G) const;
|
void dump(const ScheduleDAG *G) const;
|
||||||
void dumpAll(const SelectionDAG *G) const;
|
void dumpAll(const ScheduleDAG *G) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
|
@ -440,7 +440,7 @@ unsigned ScheduleDAG::ComputeMemOperandsEnd(SDNode *Node) {
|
|||||||
void ScheduleDAG::dumpSchedule() const {
|
void ScheduleDAG::dumpSchedule() const {
|
||||||
for (unsigned i = 0, e = Sequence.size(); i != e; i++) {
|
for (unsigned i = 0, e = Sequence.size(); i != e; i++) {
|
||||||
if (SUnit *SU = Sequence[i])
|
if (SUnit *SU = Sequence[i])
|
||||||
SU->dump(DAG);
|
SU->dump(this);
|
||||||
else
|
else
|
||||||
cerr << "**** NOOP ****\n";
|
cerr << "**** NOOP ****\n";
|
||||||
}
|
}
|
||||||
@ -459,10 +459,10 @@ void ScheduleDAG::Run() {
|
|||||||
|
|
||||||
/// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
|
/// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
|
||||||
/// a group of nodes flagged together.
|
/// a group of nodes flagged together.
|
||||||
void SUnit::dump(const SelectionDAG *G) const {
|
void SUnit::dump(const ScheduleDAG *G) const {
|
||||||
cerr << "SU(" << NodeNum << "): ";
|
cerr << "SU(" << NodeNum << "): ";
|
||||||
if (getNode())
|
if (getNode())
|
||||||
getNode()->dump(G);
|
getNode()->dump(G->DAG);
|
||||||
else
|
else
|
||||||
cerr << "CROSS RC COPY ";
|
cerr << "CROSS RC COPY ";
|
||||||
cerr << "\n";
|
cerr << "\n";
|
||||||
@ -471,13 +471,13 @@ void SUnit::dump(const SelectionDAG *G) const {
|
|||||||
FlaggedNodes.push_back(N);
|
FlaggedNodes.push_back(N);
|
||||||
while (!FlaggedNodes.empty()) {
|
while (!FlaggedNodes.empty()) {
|
||||||
cerr << " ";
|
cerr << " ";
|
||||||
FlaggedNodes.back()->dump(G);
|
FlaggedNodes.back()->dump(G->DAG);
|
||||||
cerr << "\n";
|
cerr << "\n";
|
||||||
FlaggedNodes.pop_back();
|
FlaggedNodes.pop_back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SUnit::dumpAll(const SelectionDAG *G) const {
|
void SUnit::dumpAll(const ScheduleDAG *G) const {
|
||||||
dump(G);
|
dump(G);
|
||||||
|
|
||||||
cerr << " # preds left : " << NumPredsLeft << "\n";
|
cerr << " # preds left : " << NumPredsLeft << "\n";
|
||||||
|
@ -125,7 +125,7 @@ void ScheduleDAGFast::Schedule() {
|
|||||||
BuildSchedUnits();
|
BuildSchedUnits();
|
||||||
|
|
||||||
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
|
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
|
||||||
SUnits[su].dumpAll(DAG));
|
SUnits[su].dumpAll(this));
|
||||||
|
|
||||||
// Execute the actual scheduling loop.
|
// Execute the actual scheduling loop.
|
||||||
ListScheduleBottomUp();
|
ListScheduleBottomUp();
|
||||||
@ -143,7 +143,7 @@ void ScheduleDAGFast::ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain) {
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (PredSU->NumSuccsLeft < 0) {
|
if (PredSU->NumSuccsLeft < 0) {
|
||||||
cerr << "*** Scheduling failed! ***\n";
|
cerr << "*** Scheduling failed! ***\n";
|
||||||
PredSU->dump(DAG);
|
PredSU->dump(this);
|
||||||
cerr << " has been released too many times!\n";
|
cerr << " has been released too many times!\n";
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
@ -160,7 +160,7 @@ void ScheduleDAGFast::ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain) {
|
|||||||
/// the Available queue.
|
/// the Available queue.
|
||||||
void ScheduleDAGFast::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) {
|
void ScheduleDAGFast::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) {
|
||||||
DOUT << "*** Scheduling [" << CurCycle << "]: ";
|
DOUT << "*** Scheduling [" << CurCycle << "]: ";
|
||||||
DEBUG(SU->dump(DAG));
|
DEBUG(SU->dump(this));
|
||||||
SU->Cycle = CurCycle;
|
SU->Cycle = CurCycle;
|
||||||
|
|
||||||
// Bottom up: release predecessors
|
// Bottom up: release predecessors
|
||||||
@ -613,14 +613,14 @@ void ScheduleDAGFast::ListScheduleBottomUp() {
|
|||||||
}
|
}
|
||||||
if (!AnyNotSched)
|
if (!AnyNotSched)
|
||||||
cerr << "*** List scheduling failed! ***\n";
|
cerr << "*** List scheduling failed! ***\n";
|
||||||
SUnits[i].dump(DAG);
|
SUnits[i].dump(this);
|
||||||
cerr << "has not been scheduled!\n";
|
cerr << "has not been scheduled!\n";
|
||||||
AnyNotSched = true;
|
AnyNotSched = true;
|
||||||
}
|
}
|
||||||
if (SUnits[i].NumSuccsLeft != 0) {
|
if (SUnits[i].NumSuccsLeft != 0) {
|
||||||
if (!AnyNotSched)
|
if (!AnyNotSched)
|
||||||
cerr << "*** List scheduling failed! ***\n";
|
cerr << "*** List scheduling failed! ***\n";
|
||||||
SUnits[i].dump(DAG);
|
SUnits[i].dump(this);
|
||||||
cerr << "has successors left!\n";
|
cerr << "has successors left!\n";
|
||||||
AnyNotSched = true;
|
AnyNotSched = true;
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ void ScheduleDAGList::ReleaseSucc(SUnit *SU, SUnit *SuccSU, bool isChain) {
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (SuccSU->NumPredsLeft < 0) {
|
if (SuccSU->NumPredsLeft < 0) {
|
||||||
cerr << "*** Scheduling failed! ***\n";
|
cerr << "*** Scheduling failed! ***\n";
|
||||||
SuccSU->dump(DAG);
|
SuccSU->dump(this);
|
||||||
cerr << " has been released too many times!\n";
|
cerr << " has been released too many times!\n";
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ void ScheduleDAGList::ReleaseSucc(SUnit *SU, SUnit *SuccSU, bool isChain) {
|
|||||||
/// the Available queue.
|
/// the Available queue.
|
||||||
void ScheduleDAGList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
|
void ScheduleDAGList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
|
||||||
DOUT << "*** Scheduling [" << CurCycle << "]: ";
|
DOUT << "*** Scheduling [" << CurCycle << "]: ";
|
||||||
DEBUG(SU->dump(DAG));
|
DEBUG(SU->dump(this));
|
||||||
|
|
||||||
Sequence.push_back(SU);
|
Sequence.push_back(SU);
|
||||||
SU->Cycle = CurCycle;
|
SU->Cycle = CurCycle;
|
||||||
@ -267,7 +267,7 @@ void ScheduleDAGList::ListScheduleTopDown() {
|
|||||||
if (SUnits[i].NumPredsLeft != 0) {
|
if (SUnits[i].NumPredsLeft != 0) {
|
||||||
if (!AnyNotSched)
|
if (!AnyNotSched)
|
||||||
cerr << "*** List scheduling failed! ***\n";
|
cerr << "*** List scheduling failed! ***\n";
|
||||||
SUnits[i].dump(DAG);
|
SUnits[i].dump(this);
|
||||||
cerr << "has not been scheduled!\n";
|
cerr << "has not been scheduled!\n";
|
||||||
AnyNotSched = true;
|
AnyNotSched = true;
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ void ScheduleDAGRRList::Schedule() {
|
|||||||
BuildSchedUnits();
|
BuildSchedUnits();
|
||||||
|
|
||||||
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
|
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
|
||||||
SUnits[su].dumpAll(DAG));
|
SUnits[su].dumpAll(this));
|
||||||
if (!Fast) {
|
if (!Fast) {
|
||||||
CalculateDepths();
|
CalculateDepths();
|
||||||
CalculateHeights();
|
CalculateHeights();
|
||||||
@ -271,7 +271,7 @@ void ScheduleDAGRRList::ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain) {
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (PredSU->NumSuccsLeft < 0) {
|
if (PredSU->NumSuccsLeft < 0) {
|
||||||
cerr << "*** Scheduling failed! ***\n";
|
cerr << "*** Scheduling failed! ***\n";
|
||||||
PredSU->dump(DAG);
|
PredSU->dump(this);
|
||||||
cerr << " has been released too many times!\n";
|
cerr << " has been released too many times!\n";
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
@ -301,7 +301,7 @@ void ScheduleDAGRRList::ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain) {
|
|||||||
/// the Available queue.
|
/// the Available queue.
|
||||||
void ScheduleDAGRRList::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) {
|
void ScheduleDAGRRList::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) {
|
||||||
DOUT << "*** Scheduling [" << CurCycle << "]: ";
|
DOUT << "*** Scheduling [" << CurCycle << "]: ";
|
||||||
DEBUG(SU->dump(DAG));
|
DEBUG(SU->dump(this));
|
||||||
SU->Cycle = CurCycle;
|
SU->Cycle = CurCycle;
|
||||||
|
|
||||||
AvailableQueue->ScheduledNode(SU);
|
AvailableQueue->ScheduledNode(SU);
|
||||||
@ -368,7 +368,7 @@ void ScheduleDAGRRList::CapturePred(SUnit *PredSU, SUnit *SU, bool isChain) {
|
|||||||
/// its predecessor states to reflect the change.
|
/// its predecessor states to reflect the change.
|
||||||
void ScheduleDAGRRList::UnscheduleNodeBottomUp(SUnit *SU) {
|
void ScheduleDAGRRList::UnscheduleNodeBottomUp(SUnit *SU) {
|
||||||
DOUT << "*** Unscheduling [" << SU->Cycle << "]: ";
|
DOUT << "*** Unscheduling [" << SU->Cycle << "]: ";
|
||||||
DEBUG(SU->dump(DAG));
|
DEBUG(SU->dump(this));
|
||||||
|
|
||||||
AvailableQueue->UnscheduledNode(SU);
|
AvailableQueue->UnscheduledNode(SU);
|
||||||
|
|
||||||
@ -1084,14 +1084,14 @@ void ScheduleDAGRRList::ListScheduleBottomUp() {
|
|||||||
}
|
}
|
||||||
if (!AnyNotSched)
|
if (!AnyNotSched)
|
||||||
cerr << "*** List scheduling failed! ***\n";
|
cerr << "*** List scheduling failed! ***\n";
|
||||||
SUnits[i].dump(DAG);
|
SUnits[i].dump(this);
|
||||||
cerr << "has not been scheduled!\n";
|
cerr << "has not been scheduled!\n";
|
||||||
AnyNotSched = true;
|
AnyNotSched = true;
|
||||||
}
|
}
|
||||||
if (SUnits[i].NumSuccsLeft != 0) {
|
if (SUnits[i].NumSuccsLeft != 0) {
|
||||||
if (!AnyNotSched)
|
if (!AnyNotSched)
|
||||||
cerr << "*** List scheduling failed! ***\n";
|
cerr << "*** List scheduling failed! ***\n";
|
||||||
SUnits[i].dump(DAG);
|
SUnits[i].dump(this);
|
||||||
cerr << "has successors left!\n";
|
cerr << "has successors left!\n";
|
||||||
AnyNotSched = true;
|
AnyNotSched = true;
|
||||||
}
|
}
|
||||||
@ -1117,7 +1117,7 @@ void ScheduleDAGRRList::ReleaseSucc(SUnit *SU, SUnit *SuccSU, bool isChain) {
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (SuccSU->NumPredsLeft < 0) {
|
if (SuccSU->NumPredsLeft < 0) {
|
||||||
cerr << "*** Scheduling failed! ***\n";
|
cerr << "*** Scheduling failed! ***\n";
|
||||||
SuccSU->dump(DAG);
|
SuccSU->dump(this);
|
||||||
cerr << " has been released too many times!\n";
|
cerr << " has been released too many times!\n";
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
@ -1148,7 +1148,7 @@ void ScheduleDAGRRList::ReleaseSucc(SUnit *SU, SUnit *SuccSU, bool isChain) {
|
|||||||
/// the Available queue.
|
/// the Available queue.
|
||||||
void ScheduleDAGRRList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
|
void ScheduleDAGRRList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
|
||||||
DOUT << "*** Scheduling [" << CurCycle << "]: ";
|
DOUT << "*** Scheduling [" << CurCycle << "]: ";
|
||||||
DEBUG(SU->dump(DAG));
|
DEBUG(SU->dump(this));
|
||||||
|
|
||||||
SU->Cycle = CurCycle;
|
SU->Cycle = CurCycle;
|
||||||
Sequence.push_back(SU);
|
Sequence.push_back(SU);
|
||||||
@ -1213,14 +1213,14 @@ void ScheduleDAGRRList::ListScheduleTopDown() {
|
|||||||
}
|
}
|
||||||
if (!AnyNotSched)
|
if (!AnyNotSched)
|
||||||
cerr << "*** List scheduling failed! ***\n";
|
cerr << "*** List scheduling failed! ***\n";
|
||||||
SUnits[i].dump(DAG);
|
SUnits[i].dump(this);
|
||||||
cerr << "has not been scheduled!\n";
|
cerr << "has not been scheduled!\n";
|
||||||
AnyNotSched = true;
|
AnyNotSched = true;
|
||||||
}
|
}
|
||||||
if (SUnits[i].NumPredsLeft != 0) {
|
if (SUnits[i].NumPredsLeft != 0) {
|
||||||
if (!AnyNotSched)
|
if (!AnyNotSched)
|
||||||
cerr << "*** List scheduling failed! ***\n";
|
cerr << "*** List scheduling failed! ***\n";
|
||||||
SUnits[i].dump(DAG);
|
SUnits[i].dump(this);
|
||||||
cerr << "has predecessors left!\n";
|
cerr << "has predecessors left!\n";
|
||||||
AnyNotSched = true;
|
AnyNotSched = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user