summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-08 04:37:58 +0000
committerChris Lattner <sabre@nondot.org>2006-03-08 04:37:58 +0000
commit5874f82564d6cd9da086cc705e1c5c8ec8ff8361 (patch)
tree3558d95ce06493306bf1f9ab3945ea0703f45ebf /lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
parentb0d21ef20c29f4ea46d21b488f17feaa6a8760e1 (diff)
downloadllvm-5874f82564d6cd9da086cc705e1c5c8ec8ff8361.tar.gz
llvm-5874f82564d6cd9da086cc705e1c5c8ec8ff8361.tar.bz2
llvm-5874f82564d6cd9da086cc705e1c5c8ec8ff8361.tar.xz
remove "Slot", it is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26609 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp63
1 files changed, 31 insertions, 32 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
index e089d0bc0f..b39ab7f607 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
@@ -20,7 +20,6 @@
#define DEBUG_TYPE "sched"
#include "llvm/CodeGen/ScheduleDAG.h"
-#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Support/Debug.h"
@@ -36,36 +35,36 @@ namespace {
Statistic<> NumNoops ("scheduler", "Number of noops inserted");
Statistic<> NumStalls("scheduler", "Number of pipeline stalls");
-/// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or a
-/// group of nodes flagged together.
-struct SUnit {
- SDNode *Node; // Representative node.
- std::vector<SDNode*> FlaggedNodes; // All nodes flagged to Node.
- std::set<SUnit*> Preds; // All real predecessors.
- std::set<SUnit*> ChainPreds; // All chain predecessors.
- std::set<SUnit*> Succs; // All real successors.
- std::set<SUnit*> ChainSuccs; // All chain successors.
- int NumPredsLeft; // # of preds not scheduled.
- int NumSuccsLeft; // # of succs not scheduled.
- int NumChainPredsLeft; // # of chain preds not scheduled.
- int NumChainSuccsLeft; // # of chain succs not scheduled.
- int SethiUllman; // Sethi Ullman number.
- bool isTwoAddress; // Is a two-address instruction.
- bool isDefNUseOperand; // Is a def&use operand.
- unsigned Latency; // Node latency.
- unsigned CycleBound; // Upper/lower cycle to be scheduled at.
- unsigned Slot; // Cycle node is scheduled at.
- SUnit *Next;
-
- SUnit(SDNode *node)
- : Node(node), NumPredsLeft(0), NumSuccsLeft(0),
+ /// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or a
+ /// group of nodes flagged together.
+ struct SUnit {
+ SDNode *Node; // Representative node.
+ std::vector<SDNode*> FlaggedNodes; // All nodes flagged to Node.
+ std::set<SUnit*> Preds; // All real predecessors.
+ std::set<SUnit*> ChainPreds; // All chain predecessors.
+ std::set<SUnit*> Succs; // All real successors.
+ std::set<SUnit*> ChainSuccs; // All chain successors.
+ int NumPredsLeft; // # of preds not scheduled.
+ int NumSuccsLeft; // # of succs not scheduled.
+ int NumChainPredsLeft; // # of chain preds not scheduled.
+ int NumChainSuccsLeft; // # of chain succs not scheduled.
+ int SethiUllman; // Sethi Ullman number.
+ bool isTwoAddress; // Is a two-address instruction.
+ bool isDefNUseOperand; // Is a def&use operand.
+ unsigned Latency; // Node latency.
+ unsigned CycleBound; // Upper/lower cycle to be scheduled at.
+ SUnit *Next;
+
+ SUnit(SDNode *node)
+ : Node(node), NumPredsLeft(0), NumSuccsLeft(0),
NumChainPredsLeft(0), NumChainSuccsLeft(0),
SethiUllman(INT_MIN),
isTwoAddress(false), isDefNUseOperand(false),
- Latency(0), CycleBound(0), Slot(0), Next(NULL) {}
-
- void dump(const SelectionDAG *G, bool All=true) const;
-};
+ Latency(0), CycleBound(0), Next(NULL) {}
+
+ void dump(const SelectionDAG *G, bool All=true) const;
+ };
+}
void SUnit::dump(const SelectionDAG *G, bool All) const {
std::cerr << "SU: ";
@@ -122,6 +121,7 @@ void SUnit::dump(const SelectionDAG *G, bool All) const {
}
}
+namespace {
/// Sorting functions for the Available queue.
struct ls_rr_sort : public std::binary_function<SUnit*, SUnit*, bool> {
bool operator()(const SUnit* left, const SUnit* right) const {
@@ -159,8 +159,10 @@ struct ls_rr_sort : public std::binary_function<SUnit*, SUnit*, bool> {
return false;
}
};
+} // end anonymous namespace
+namespace {
/// ScheduleDAGList - List scheduler.
class ScheduleDAGList : public ScheduleDAG {
private:
@@ -219,7 +221,7 @@ private:
void BuildSchedUnits();
void EmitSchedule();
};
-} // end namespace
+} // end anonymous namespace
HazardRecognizer::~HazardRecognizer() {}
@@ -305,7 +307,6 @@ void ScheduleDAGList::ScheduleNodeBottomUp(AvailableQueueTy &Available,
DEBUG(SU->dump(&DAG, false));
Sequence.push_back(SU);
- SU->Slot = CurrCycle;
// Bottom up: release predecessors
for (std::set<SUnit*>::iterator I1 = SU->Preds.begin(),
@@ -329,7 +330,6 @@ void ScheduleDAGList::ScheduleNodeTopDown(AvailableQueueTy &Available,
DEBUG(SU->dump(&DAG, false));
Sequence.push_back(SU);
- SU->Slot = CurrCycle;
// Bottom up: release successors.
for (std::set<SUnit*>::iterator I1 = SU->Succs.begin(),
@@ -384,7 +384,6 @@ void ScheduleDAGList::ListScheduleBottomUp() {
// Add entry node last
if (DAG.getEntryNode().Val != DAG.getRoot().Val) {
SUnit *Entry = SUnitMap[DAG.getEntryNode().Val];
- Entry->Slot = CurrCycle;
Sequence.push_back(Entry);
}