15 #ifndef LLVM_CODEGEN_SCHEDULEDAGINSTRS_H
16 #define LLVM_CODEGEN_SCHEDULEDAGINSTRS_H
26 class MachineFrameInfo;
27 class MachineLoopInfo;
28 class MachineDominatorTree;
30 class RegPressureTracker;
60 typedef SparseMultiSet<PhysRegSUOper, llvm::identity<unsigned>, uint16_t>
143 typedef std::vector<std::pair<MachineInstr *, MachineInstr *> >
192 unsigned regioninstrs);
244 assert((Addr == 0 || Addr == &
SUnits[0]) &&
245 "SUnits std::vector reallocated on the fly!");
virtual void finishBlock()
finishBlock - Clean up after scheduling in the given block.
const MCSchedClassDesc * resolveSchedClass(const MachineInstr *MI) const
Return the MCSchedClassDesc for this instruction.
unsigned getSparseSetIndex() const
static unsigned virtReg2Index(unsigned Reg)
void addVRegDefDeps(SUnit *SU, unsigned OperIdx)
MachineInstr * getInstr() const
TargetSchedModel SchedModel
TargetSchedModel provides an interface to the machine model.
bool CanHandleTerminators
MachineBasicBlock::iterator begin() const
begin - Return an iterator to the top of the current scheduling region.
const MCSchedClassDesc * getSchedClass(SUnit *SU) const
Resolve and cache a resolved scheduling class for an SUnit.
virtual std::string getDAGName() const
Return a label for the region of code covered by the DAG.
unsigned NumRegionInstrs
Instructions in this region (distance(RegionBegin, RegionEnd)).
void addPhysRegDataDeps(SUnit *SU, unsigned OperIdx)
virtual void startBlock(MachineBasicBlock *BB)
startBlock - Prepare to perform scheduling in the given block.
const TargetSchedModel * getSchedModel() const
Get the machine model for instruction scheduling.
std::vector< SUnit * > PendingLoads
MachineBasicBlock::iterator RegionEnd
The end of the range to be scheduled.
DenseMap< MachineInstr *, SUnit * > MISUnitMap
VReg2SUnit(unsigned reg, SUnit *su)
void addSchedBarrierDeps()
Provide an instruction scheduling machine model to CodeGen passes.
An individual mapping from virtual register number to SUnit.
virtual void dumpNode(const SUnit *SU) const
Abstract Stack Frame Information.
const MachineFrameInfo * MFI
MachineBasicBlock::iterator RegionBegin
The beginning of the range to be scheduled.
void addVRegUseDeps(SUnit *SU, unsigned OperIdx)
const MachineLoopInfo & MLI
bool IsPostRA
isPostRA flag indicates vregs cannot be present.
virtual void enterRegion(MachineBasicBlock *bb, MachineBasicBlock::iterator begin, MachineBasicBlock::iterator end, unsigned regioninstrs)
Initialize the scheduler state for the next scheduling region.
bundle_iterator< MachineInstr, instr_iterator > iterator
ScheduleDAGInstrs(MachineFunction &mf, const MachineLoopInfo &mli, const MachineDominatorTree &mdt, bool IsPostRAFlag, LiveIntervals *LIS=0)
virtual ~ScheduleDAGInstrs()
VReg2SUnitMap VRegDefs
Track the last instruction in this region defining each virtual register.
virtual void exitRegion()
Notify that the scheduler has finished scheduling the current region.
const MCSchedClassDesc * SchedClass
LiveIntervals * getLIS() const
Expose LiveIntervals for use in DAG mutators and such.
const MachineDominatorTree & MDT
void addPhysRegDeps(SUnit *SU, unsigned OperIdx)
bool hasInstrSchedModel() const
Return true if this machine model includes an instruction-level scheduling model. ...
PhysRegSUOper(SUnit *su, int op, unsigned R)
virtual void finalizeSchedule()
virtual void schedule()=0
MachineBasicBlock::iterator end() const
end - Return an iterator to the bottom of the current scheduling region.
SUnit * getSUnit(MachineInstr *MI) const
getSUnit - Return an existing SUnit for this MI, or NULL.
SparseMultiSet< VReg2SUnit, VirtReg2IndexFunctor > VReg2UseMap
unsigned getSparseSetIndex() const
SUnit * newSUnit(MachineInstr *MI)
newSUnit - Creates a new SUnit and return a ptr to it.
SparseSet< VReg2SUnit, VirtReg2IndexFunctor > VReg2SUnitMap
virtual std::string getGraphNodeLabel(const SUnit *SU) const
Return a label for a DAG node that points to an instruction.
SparseMultiSet< PhysRegSUOper, llvm::identity< unsigned >, uint16_t > Reg2SUnitsMap
MachineInstr * FirstDbgValue
MachineBasicBlock * BB
The block in which to insert instructions.
std::vector< SUnit > SUnits
void buildSchedGraph(AliasAnalysis *AA, RegPressureTracker *RPTracker=0, PressureDiffs *PDiffs=0)
LiveIntervals * LIS
Live Intervals provides reaching defs in preRA scheduling.
std::vector< std::pair< MachineInstr *, MachineInstr * > > DbgValueVector
SUnit - Scheduling unit. This is a node in the scheduling DAG.