Experimental post-pass scheduling support. Post-pass scheduling
[oota-llvm.git] / include / llvm / CodeGen / ScheduleDAGInstrs.h
1 //==- llvm/CodeGen/ScheduleDAGInstrs.h - MachineInstr Scheduling -*- C++ -*-==//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the ScheduleDAGInstrs class, which implements
11 // scheduling for a MachineInstr-based dependency graph.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CODEGEN_SCHEDULEDAGINSTRS_H
16 #define LLVM_CODEGEN_SCHEDULEDAGINSTRS_H
17
18 #include "llvm/CodeGen/ScheduleDAG.h"
19
20 namespace llvm {
21   struct SUnit;
22   class MachineConstantPool;
23   class MachineFunction;
24   class MachineModuleInfo;
25   class MachineRegisterInfo;
26   class MachineInstr;
27   class TargetRegisterInfo;
28   class ScheduleDAG;
29   class SelectionDAG;
30   class SelectionDAGISel;
31   class TargetInstrInfo;
32   class TargetInstrDesc;
33   class TargetLowering;
34   class TargetMachine;
35   class TargetRegisterClass;
36
37   class ScheduleDAGInstrs : public ScheduleDAG {
38   public:
39     ScheduleDAGInstrs(MachineBasicBlock *bb,
40                       const TargetMachine &tm);
41
42     virtual ~ScheduleDAGInstrs() {}
43
44     /// NewSUnit - Creates a new SUnit and return a ptr to it.
45     ///
46     SUnit *NewSUnit(MachineInstr *MI) {
47       SUnits.push_back(SUnit(MI, (unsigned)SUnits.size()));
48       SUnits.back().OrigNode = &SUnits.back();
49       return &SUnits.back();
50     }
51
52     /// BuildSchedUnits - Build SUnits from the MachineBasicBlock that we are
53     /// input.
54     virtual void BuildSchedUnits();
55
56     virtual MachineBasicBlock *EmitSchedule();
57
58     /// Schedule - Order nodes according to selected style, filling
59     /// in the Sequence member.
60     ///
61     virtual void Schedule() = 0;
62
63     virtual void dumpNode(const SUnit *SU) const;
64
65     virtual std::string getGraphNodeLabel(const SUnit *SU) const;
66   };
67 }
68
69 #endif