aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
blob: dca430257cb323307aaffaa1823dd0ef22f2a51f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//===-- ScheduleDAGSimple.cpp - Implement a list scheduler for isel DAG ---===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by Evan Cheng and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This implements a simple two pass scheduler.  The first pass attempts to push
// backward any lengthy instructions and critical paths.  The second pass packs
// instructions into semi-optimal time slots.
//
//===----------------------------------------------------------------------===//

#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 <algorithm>
#include <queue>
using namespace llvm;


namespace llvm {
/// Sorting functions for ready queue.
struct LSSortPred : public std::binary_function<SDOperand, SDOperand, bool> {
  bool operator()(const SDOperand* left, const SDOperand* right) const {
    return true;
  }
};

/// ScheduleDAGList - List scheduler.

class ScheduleDAGList : public ScheduleDAG {
private:
  LSSortPred &Cmp;

  // Ready queue
  std::priority_queue<SDOperand*, std::vector<SDOperand*>, LSSortPred> Ready;
                      
public:
  ScheduleDAGList(SelectionDAG &dag, MachineBasicBlock *bb,
                  const TargetMachine &tm, LSSortPred cmp)
    : ScheduleDAG(listSchedulingBURR, dag, bb, tm), Cmp(cmp), Ready(Cmp)
  {};

  void Schedule();
};
}  // end namespace llvm

void ScheduleDAGList::Schedule() {
}
  

llvm::ScheduleDAG*
llvm::createBURRListDAGScheduler(SelectionDAG &DAG,
                                 MachineBasicBlock *BB) {
  return new ScheduleDAGList(DAG, BB, DAG.getTarget(), LSSortPred());
}