- if (All) {
- std::cerr << "# preds left : " << NumPredsLeft << "\n";
- std::cerr << "# succs left : " << NumSuccsLeft << "\n";
- std::cerr << "Latency : " << Latency << "\n";
- std::cerr << "Priority : " << Priority1 << " , " << Priority2 << "\n";
-
- if (Preds.size() != 0) {
- std::cerr << "Predecessors :\n";
- for (unsigned i = 0, e = Preds.size(); i != e; i++) {
- std::cerr << " ";
- Preds[i]->dump(G, false);
- }
- }
- if (ChainPreds.size() != 0) {
- std::cerr << "Chained Preds :\n";
- for (unsigned i = 0, e = ChainPreds.size(); i != e; i++) {
- std::cerr << " ";
- ChainPreds[i]->dump(G, false);
- }
- }
- if (Succs.size() != 0) {
- std::cerr << "Successors :\n";
- for (unsigned i = 0, e = Succs.size(); i != e; i++) {
- std::cerr << " ";
- Succs[i]->dump(G, false);
- }
- }
- if (ChainSuccs.size() != 0) {
- std::cerr << "Chained succs :\n";
- for (unsigned i = 0, e = ChainSuccs.size(); i != e; i++) {
- std::cerr << " ";
- ChainSuccs[i]->dump(G, false);
- }
- }
- }
-}
-
-/// 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 {
- if (left->Priority1 > right->Priority1) {
- return true;
- } else if (left->Priority1 == right->Priority1) {
- unsigned lf = left->FlaggedNodes.size();
- unsigned rf = right->FlaggedNodes.size();
- if (lf > rf)
- return true;
- else if (lf == rf) {
- if (left->Priority2 > right->Priority2)
- return true;
- else if (left->Priority2 == right->Priority2) {
- if (left->CycleBound > right->CycleBound)
- return true;
- else
- return left->Node->getNodeDepth() < right->Node->getNodeDepth();
- }
- }
- }
-
- return false;
- }
-};
-
-/// ScheduleDAGList - List scheduler.
-class ScheduleDAGList : public ScheduleDAG {
+static RegisterScheduler
+ tdListDAGScheduler("list-td", " Top-down list scheduler",
+ createTDListDAGScheduler);
+
+namespace {
+//===----------------------------------------------------------------------===//
+/// ScheduleDAGList - The actual list scheduler implementation. This supports
+/// top-down scheduling.
+///
+class VISIBILITY_HIDDEN ScheduleDAGList : public ScheduleDAG {