LLVM 19.0.0git
Public Member Functions | List of all members
llvm::ModuloSchedule Class Reference

Represents a schedule for a single-block loop. More...

#include "llvm/CodeGen/ModuloSchedule.h"

Public Member Functions

 ModuloSchedule (MachineFunction &MF, MachineLoop *Loop, std::vector< MachineInstr * > ScheduledInstrs, DenseMap< MachineInstr *, int > Cycle, DenseMap< MachineInstr *, int > Stage)
 Create a new ModuloSchedule.
 
MachineLoopgetLoop () const
 Return the single-block loop being scheduled.
 
int getNumStages () const
 Return the number of stages contained in this schedule, which is the largest stage index + 1.
 
int getFirstCycle ()
 Return the first cycle in the schedule, which is the cycle index of the first instruction.
 
int getFinalCycle ()
 Return the final cycle in the schedule, which is the cycle index of the last instruction.
 
int getStage (MachineInstr *MI)
 Return the stage that MI is scheduled in, or -1.
 
int getCycle (MachineInstr *MI)
 Return the cycle that MI is scheduled at, or -1.
 
void setStage (MachineInstr *MI, int MIStage)
 Set the stage of a newly created instruction.
 
ArrayRef< MachineInstr * > getInstructions ()
 Return the rescheduled instructions in order.
 
void dump ()
 
void print (raw_ostream &OS)
 

Detailed Description

Represents a schedule for a single-block loop.

For every instruction we maintain a Cycle and Stage.

Definition at line 80 of file ModuloSchedule.h.

Constructor & Destructor Documentation

◆ ModuloSchedule()

llvm::ModuloSchedule::ModuloSchedule ( MachineFunction MF,
MachineLoop Loop,
std::vector< MachineInstr * >  ScheduledInstrs,
DenseMap< MachineInstr *, int >  Cycle,
DenseMap< MachineInstr *, int >  Stage 
)
inline

Create a new ModuloSchedule.

  • ScheduledInstrs The new loop instructions, in total resequenced order.
  • Cycle Cycle index for all instructions in ScheduledInstrs. Cycle does not need to start at zero. ScheduledInstrs must be partially ordered by Cycle.
  • Stage Stage index for all instructions in ScheduleInstrs.

Definition at line 107 of file ModuloSchedule.h.

Member Function Documentation

◆ dump()

void llvm::ModuloSchedule::dump ( )
inline

Definition at line 155 of file ModuloSchedule.h.

References llvm::dbgs(), and print().

Referenced by llvm::PeelingModuloScheduleExpander::expand().

◆ getCycle()

int llvm::ModuloSchedule::getCycle ( MachineInstr MI)
inline

Return the cycle that MI is scheduled at, or -1.

Definition at line 141 of file ModuloSchedule.h.

References I, and MI.

Referenced by llvm::ModuloScheduleTestAnnotater::annotate(), and print().

◆ getFinalCycle()

int llvm::ModuloSchedule::getFinalCycle ( )
inline

Return the final cycle in the schedule, which is the cycle index of the last instruction.

Definition at line 132 of file ModuloSchedule.h.

◆ getFirstCycle()

int llvm::ModuloSchedule::getFirstCycle ( )
inline

Return the first cycle in the schedule, which is the cycle index of the first instruction.

Definition at line 128 of file ModuloSchedule.h.

◆ getInstructions()

ArrayRef< MachineInstr * > llvm::ModuloSchedule::getInstructions ( )
inline

Return the rescheduled instructions in order.

Definition at line 153 of file ModuloSchedule.h.

Referenced by llvm::ModuloScheduleTestAnnotater::annotate(), and llvm::ModuloScheduleExpander::expand().

◆ getLoop()

MachineLoop * llvm::ModuloSchedule::getLoop ( ) const
inline

◆ getNumStages()

int llvm::ModuloSchedule::getNumStages ( ) const
inline

Return the number of stages contained in this schedule, which is the largest stage index + 1.

Definition at line 124 of file ModuloSchedule.h.

Referenced by llvm::PeelingModuloScheduleExpander::fixupBranches(), and llvm::PeelingModuloScheduleExpander::peelPrologAndEpilogs().

◆ getStage()

int llvm::ModuloSchedule::getStage ( MachineInstr MI)
inline

◆ print()

void ModuloSchedule::print ( raw_ostream OS)

◆ setStage()

void llvm::ModuloSchedule::setStage ( MachineInstr MI,
int  MIStage 
)
inline

Set the stage of a newly created instruction.

Definition at line 147 of file ModuloSchedule.h.

References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), and MI.


The documentation for this class was generated from the following files: