summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-11-13 21:21:28 +0000
committerDan Gohman <gohman@apple.com>2008-11-13 21:21:28 +0000
commita23b3b803e3c65e84d6cadaa221de8b256cbe28d (patch)
tree12617e8167fb13e7cf02f62a7b69d2369eb632c7 /lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
parenteee085287884c94ee8576c997ef033b8088ae519 (diff)
downloadllvm-a23b3b803e3c65e84d6cadaa221de8b256cbe28d.tar.gz
llvm-a23b3b803e3c65e84d6cadaa221de8b256cbe28d.tar.bz2
llvm-a23b3b803e3c65e84d6cadaa221de8b256cbe28d.tar.xz
Change ScheduleDAG's DAG member from a reference to a pointer, to prepare
for the possibility of scheduling without a SelectionDAG being present. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59263 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
index d205f3d090..c146e15840 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
@@ -71,7 +71,7 @@ private:
std::vector<unsigned> LiveRegCycles;
public:
- ScheduleDAGFast(SelectionDAG &dag, MachineBasicBlock *bb,
+ ScheduleDAGFast(SelectionDAG *dag, MachineBasicBlock *bb,
const TargetMachine &tm)
: ScheduleDAG(dag, bb, tm) {}
@@ -125,7 +125,7 @@ void ScheduleDAGFast::Schedule() {
BuildSchedUnits();
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
- SUnits[su].dumpAll(&DAG));
+ SUnits[su].dumpAll(DAG));
// Execute the actual scheduling loop.
ListScheduleBottomUp();
@@ -150,7 +150,7 @@ void ScheduleDAGFast::ReleasePred(SUnit *PredSU, bool isChain,
#ifndef NDEBUG
if (PredSU->NumSuccsLeft < 0) {
cerr << "*** List scheduling failed! ***\n";
- PredSU->dump(&DAG);
+ PredSU->dump(DAG);
cerr << " has been released too many times!\n";
assert(0);
}
@@ -167,7 +167,7 @@ void ScheduleDAGFast::ReleasePred(SUnit *PredSU, bool isChain,
/// the Available queue.
void ScheduleDAGFast::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) {
DOUT << "*** Scheduling [" << CurCycle << "]: ";
- DEBUG(SU->dump(&DAG));
+ DEBUG(SU->dump(DAG));
SU->Cycle = CurCycle;
// Bottom up: release predecessors
@@ -246,7 +246,7 @@ SUnit *ScheduleDAGFast::CopyAndMoveSuccessors(SUnit *SU) {
if (TryUnfold) {
SmallVector<SDNode*, 2> NewNodes;
- if (!TII->unfoldMemoryOperand(DAG, N, NewNodes))
+ if (!TII->unfoldMemoryOperand(*DAG, N, NewNodes))
return NULL;
DOUT << "Unfolding SU # " << SU->NodeNum << "\n";
@@ -257,9 +257,9 @@ SUnit *ScheduleDAGFast::CopyAndMoveSuccessors(SUnit *SU) {
unsigned NumVals = N->getNumValues();
unsigned OldNumVals = SU->Node->getNumValues();
for (unsigned i = 0; i != NumVals; ++i)
- DAG.ReplaceAllUsesOfValueWith(SDValue(SU->Node, i), SDValue(N, i));
- DAG.ReplaceAllUsesOfValueWith(SDValue(SU->Node, OldNumVals-1),
- SDValue(LoadNode, 1));
+ DAG->ReplaceAllUsesOfValueWith(SDValue(SU->Node, i), SDValue(N, i));
+ DAG->ReplaceAllUsesOfValueWith(SDValue(SU->Node, OldNumVals-1),
+ SDValue(LoadNode, 1));
SUnit *NewSU = CreateNewSUnit(N);
assert(N->getNodeId() == -1 && "Node already inserted!");
@@ -515,7 +515,7 @@ void ScheduleDAGFast::ListScheduleBottomUp() {
unsigned CurCycle = 0;
// Add root to Available queue.
if (!SUnits.empty()) {
- SUnit *RootSU = &SUnits[DAG.getRoot().getNode()->getNodeId()];
+ SUnit *RootSU = &SUnits[DAG->getRoot().getNode()->getNodeId()];
assert(RootSU->Succs.empty() && "Graph root shouldn't have successors!");
RootSU->isAvailable = true;
AvailableQueue.push(RootSU);
@@ -625,14 +625,14 @@ void ScheduleDAGFast::ListScheduleBottomUp() {
}
if (!AnyNotSched)
cerr << "*** List scheduling failed! ***\n";
- SUnits[i].dump(&DAG);
+ SUnits[i].dump(DAG);
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(DAG);
cerr << "has successors left!\n";
AnyNotSched = true;
}
@@ -654,5 +654,5 @@ llvm::ScheduleDAG* llvm::createFastDAGScheduler(SelectionDAGISel *IS,
SelectionDAG *DAG,
const TargetMachine *TM,
MachineBasicBlock *BB, bool) {
- return new ScheduleDAGFast(*DAG, BB, *TM);
+ return new ScheduleDAGFast(DAG, BB, *TM);
}