1 //==- llvm/CodeGen/ScheduleDAGInstrs.h - MachineInstr Scheduling -*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the ScheduleDAGInstrs class, which implements
11 // scheduling for a MachineInstr-based dependency graph.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CODEGEN_SCHEDULEDAGINSTRS_H
16 #define LLVM_CODEGEN_SCHEDULEDAGINSTRS_H
18 #include "llvm/CodeGen/ScheduleDAG.h"
21 class ScheduleDAGInstrs : public ScheduleDAG {
23 ScheduleDAGInstrs(MachineBasicBlock *bb,
24 const TargetMachine &tm);
26 virtual ~ScheduleDAGInstrs() {}
28 /// NewSUnit - Creates a new SUnit and return a ptr to it.
30 SUnit *NewSUnit(MachineInstr *MI) {
31 SUnits.push_back(SUnit(MI, (unsigned)SUnits.size()));
32 SUnits.back().OrigNode = &SUnits.back();
33 return &SUnits.back();
36 /// BuildSchedUnits - Build SUnits from the MachineBasicBlock that we are
38 virtual void BuildSchedUnits();
40 /// ComputeLatency - Compute node latency.
42 virtual void ComputeLatency(SUnit *SU);
44 virtual MachineBasicBlock *EmitSchedule();
46 /// Schedule - Order nodes according to selected style, filling
47 /// in the Sequence member.
49 virtual void Schedule() = 0;
51 virtual void dumpNode(const SUnit *SU) const;
53 virtual std::string getGraphNodeLabel(const SUnit *SU) const;