class SMSchedule
Declaration
class SMSchedule { /* full declaration omitted */ };
Description
This class represents the scheduled code. The main data structure is a map from scheduled cycle to instructions. During scheduling, the data structure explicitly represents all stages/iterations. When the algorithm finshes, the schedule is collapsed into a single stage, which represents instructions from different loop iterations. The SMS algorithm allows negative values for cycles, so the first cycle in the schedule is the smallest cycle value.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:482
Method Overview
- public SMSchedule(llvm::MachineFunction * mf)
- public void computeStart(llvm::SUnit * SU, int * MaxEarlyStart, int * MinLateStart, int * MinEnd, int * MaxStart, int II, llvm::SwingSchedulerDAG * DAG)
- public unsigned int cycleScheduled(llvm::SUnit * SU) const
- public void dump() const
- public int earliestCycleInChain(const llvm::SDep & Dep)
- public void finalizeSchedule(llvm::SwingSchedulerDAG * SSD)
- public int getFinalCycle() const
- public int getFirstCycle() const
- public std::deque<SUnit *> & getInstructions(int cycle)
- public unsigned int getMaxStageCount()
- public bool insert(llvm::SUnit * SU, int StartCycle, int EndCycle, int II)
- public bool isLoopCarried(llvm::SwingSchedulerDAG * SSD, llvm::MachineInstr & Phi)
- public bool isLoopCarriedDefOfUse(llvm::SwingSchedulerDAG * SSD, llvm::MachineInstr * Def, llvm::MachineOperand & MO)
- public bool isScheduledAtStage(llvm::SUnit * SU, unsigned int StageNum)
- public bool isValidSchedule(llvm::SwingSchedulerDAG * SSD)
- public int latestCycleInChain(const llvm::SDep & Dep)
- public void orderDependence(llvm::SwingSchedulerDAG * SSD, llvm::SUnit * SU, std::deque<SUnit *> & Insts)
- public void print(llvm::raw_ostream & os) const
- public void reset()
- public void setInitiationInterval(int ii)
- public int stageScheduled(llvm::SUnit * SU) const
Methods
¶SMSchedule(llvm::MachineFunction* mf)
SMSchedule(llvm::MachineFunction* mf)
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:509
Parameters
¶void computeStart(llvm::SUnit* SU,
int* MaxEarlyStart,
int* MinLateStart,
int* MinEnd,
int* MaxStart,
int II,
llvm::SwingSchedulerDAG* DAG)
void computeStart(llvm::SUnit* SU,
int* MaxEarlyStart,
int* MinLateStart,
int* MinEnd,
int* MaxStart,
int II,
llvm::SwingSchedulerDAG* DAG)
Description
Compute the scheduling start slot for the instruction. The start slot depends on any predecessor or successor nodes scheduled already.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:538
Parameters
- llvm::SUnit* SU
- int* MaxEarlyStart
- int* MinLateStart
- int* MinEnd
- int* MaxStart
- int II
- llvm::SwingSchedulerDAG* DAG
¶unsigned int cycleScheduled(llvm::SUnit* SU) const
unsigned int cycleScheduled(llvm::SUnit* SU) const
Description
Return the cycle for a scheduled instruction. This function normalizes the first cycle to be 0.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:563
Parameters
- llvm::SUnit* SU
¶void dump() const
void dump() const
Description
Utility function used for debugging to print the schedule.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:587
¶int earliestCycleInChain(const llvm::SDep& Dep)
int earliestCycleInChain(const llvm::SDep& Dep)
Description
Return the cycle of the earliest scheduled instruction in the dependence chain.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:532
Parameters
- const llvm::SDep& Dep
¶void finalizeSchedule(
llvm::SwingSchedulerDAG* SSD)
void finalizeSchedule(
llvm::SwingSchedulerDAG* SSD)
Description
After the schedule has been formed, call this function to combine the instructions from the different stages/cycles. That is, this function creates a schedule that represents a single iteration.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:580
Parameters
¶int getFinalCycle() const
int getFinalCycle() const
Description
Return the last cycle in the finalized schedule.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:528
¶int getFirstCycle() const
int getFirstCycle() const
Description
Return the first cycle in the completed schedule. This can be a negative value.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:525
¶std::deque<SUnit*>& getInstructions(int cycle)
std::deque<SUnit*>& getInstructions(int cycle)
Description
Return the instructions that are scheduled at the specified cycle.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:575
Parameters
- int cycle
¶unsigned int getMaxStageCount()
unsigned int getMaxStageCount()
Description
Return the maximum stage count needed for this schedule.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:570
¶bool insert(llvm::SUnit* SU,
int StartCycle,
int EndCycle,
int II)
bool insert(llvm::SUnit* SU,
int StartCycle,
int EndCycle,
int II)
Description
Try to schedule the node at the specified StartCycle and continue until the node is schedule or the EndCycle is reached. This function returns true if the node is scheduled. This routine may search either forward or backward for a place to insert the instruction based upon the relative values of StartCycle and EndCycle.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:540
Parameters
- llvm::SUnit* SU
- int StartCycle
- int EndCycle
- int II
¶bool isLoopCarried(llvm::SwingSchedulerDAG* SSD,
llvm::MachineInstr& Phi)
bool isLoopCarried(llvm::SwingSchedulerDAG* SSD,
llvm::MachineInstr& Phi)
Description
Return true if the scheduled Phi has a loop carried operand.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:583
Parameters
¶bool isLoopCarriedDefOfUse(
llvm::SwingSchedulerDAG* SSD,
llvm::MachineInstr* Def,
llvm::MachineOperand& MO)
bool isLoopCarriedDefOfUse(
llvm::SwingSchedulerDAG* SSD,
llvm::MachineInstr* Def,
llvm::MachineOperand& MO)
Description
Return true if the instruction is a definition that is loop carried and defines the use on the next iteration. v1 = phi(v2, v3) (Def) v3 = op v1 (MO) = v1 If MO appears before Def, then then v1 and v3 may get assigned to the same register.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:584
Parameters
¶bool isScheduledAtStage(llvm::SUnit* SU,
unsigned int StageNum)
bool isScheduledAtStage(llvm::SUnit* SU,
unsigned int StageNum)
Description
Return true if the instruction is scheduled at the specified stage.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:548
Parameters
- llvm::SUnit* SU
- unsigned int StageNum
¶bool isValidSchedule(llvm::SwingSchedulerDAG* SSD)
bool isValidSchedule(llvm::SwingSchedulerDAG* SSD)
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:579
Parameters
¶int latestCycleInChain(const llvm::SDep& Dep)
int latestCycleInChain(const llvm::SDep& Dep)
Description
Return the cycle of the latest scheduled instruction in the dependence chain.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:536
Parameters
- const llvm::SDep& Dep
¶void orderDependence(llvm::SwingSchedulerDAG* SSD,
llvm::SUnit* SU,
std::deque<SUnit*>& Insts)
void orderDependence(llvm::SwingSchedulerDAG* SSD,
llvm::SUnit* SU,
std::deque<SUnit*>& Insts)
Description
Order the instructions within a cycle so that the definitions occur before the uses. Returns true if the instruction is added to the start of the list, or false if added to the end.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:581
Parameters
- llvm::SwingSchedulerDAG* SSD
- llvm::SUnit* SU
- std::deque<SUnit*>& Insts
¶void print(llvm::raw_ostream& os) const
void print(llvm::raw_ostream& os) const
Description
Print the schedule information to the given output.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:586
Parameters
¶void reset()
void reset()
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:512
¶void setInitiationInterval(int ii)
void setInitiationInterval(int ii)
Description
Set the initiation interval for this schedule.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:521
Parameters
- int ii
¶int stageScheduled(llvm::SUnit* SU) const
int stageScheduled(llvm::SUnit* SU) const
Description
Return the stage for a scheduled instruction. Return -1 if the instruction has not been scheduled.
Declared at: llvm/include/llvm/CodeGen/MachinePipeliner.h:554
Parameters
- llvm::SUnit* SU