LLVM 20.0.0git
Classes | Public Types | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::GenericSchedulerBase Class Reference

Base class for GenericScheduler. More...

#include "llvm/CodeGen/MachineScheduler.h"

Inheritance diagram for llvm::GenericSchedulerBase:
Inheritance graph
[legend]

Classes

struct  CandPolicy
 Policy for scheduling the next instruction in the candidate's zone. More...
 
struct  SchedCandidate
 Store the state used by GenericScheduler heuristics, required for the lifetime of one invocation of pickNode(). More...
 
struct  SchedResourceDelta
 Status of an instruction's critical resource consumption. More...
 

Public Types

enum  CandReason : uint8_t {
  NoCand , Only1 , PhysReg , RegExcess ,
  RegCritical , Stall , Cluster , Weak ,
  RegMax , ResourceReduce , ResourceDemand , BotHeightReduce ,
  BotPathReduce , TopDepthReduce , TopPathReduce , NextDefUse ,
  NodeOrder
}
 Represent the type of SchedCandidate found within a single queue. More...
 

Static Public Member Functions

static const chargetReasonStr (GenericSchedulerBase::CandReason Reason)
 

Protected Member Functions

 GenericSchedulerBase (const MachineSchedContext *C)
 
void setPolicy (CandPolicy &Policy, bool IsPostRA, SchedBoundary &CurrZone, SchedBoundary *OtherZone)
 Set the CandPolicy given a scheduling zone given the current resources and latencies inside and outside the zone.
 
MachineSchedPolicy getPolicy () const override
 
void traceCandidate (const SchedCandidate &Cand)
 

Protected Attributes

const MachineSchedContextContext
 
const TargetSchedModelSchedModel = nullptr
 
const TargetRegisterInfoTRI = nullptr
 
MachineSchedPolicy RegionPolicy
 
SchedRemainder Rem
 

Additional Inherited Members

- Public Member Functions inherited from llvm::MachineSchedStrategy
virtual ~MachineSchedStrategy ()=default
 
virtual void initPolicy (MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, unsigned NumRegionInstrs)
 Optionally override the per-region scheduling policy.
 
virtual MachineSchedPolicy getPolicy () const
 
virtual void dumpPolicy () const
 
virtual bool shouldTrackPressure () const
 Check if pressure tracking is needed before building the DAG and initializing this strategy.
 
virtual bool shouldTrackLaneMasks () const
 Returns true if lanemasks should be tracked.
 
virtual bool doMBBSchedRegionsTopDown () const
 
virtual void initialize (ScheduleDAGMI *DAG)=0
 Initialize the strategy after building the DAG for a new region.
 
virtual void enterMBB (MachineBasicBlock *MBB)
 Tell the strategy that MBB is about to be processed.
 
virtual void leaveMBB ()
 Tell the strategy that current MBB is done.
 
virtual void registerRoots ()
 Notify this strategy that all roots have been released (including those that depend on EntrySU or ExitSU).
 
virtual SUnitpickNode (bool &IsTopNode)=0
 Pick the next node to schedule, or return NULL.
 
virtual void scheduleTree (unsigned SubtreeID)
 Scheduler callback to notify that a new subtree is scheduled.
 
virtual void schedNode (SUnit *SU, bool IsTopNode)=0
 Notify MachineSchedStrategy that ScheduleDAGMI has scheduled an instruction and updated scheduled/remaining flags in the DAG nodes.
 
virtual void releaseTopNode (SUnit *SU)=0
 When all predecessor dependencies have been resolved, free this node for top-down scheduling.
 
virtual void releaseBottomNode (SUnit *SU)=0
 When all successor dependencies have been resolved, free this node for bottom-up scheduling.
 

Detailed Description

Base class for GenericScheduler.

This class maintains information about scheduling candidates based on TargetSchedModel making it easy to implement heuristics for either preRA or postRA scheduling.

Definition at line 1076 of file MachineScheduler.h.

Member Enumeration Documentation

◆ CandReason

Represent the type of SchedCandidate found within a single queue.

pickNodeBidirectional depends on these listed by decreasing priority.

Enumerator
NoCand 
Only1 
PhysReg 
RegExcess 
RegCritical 
Stall 
Cluster 
Weak 
RegMax 
ResourceReduce 
ResourceDemand 
BotHeightReduce 
BotPathReduce 
TopDepthReduce 
TopPathReduce 
NextDefUse 
NodeOrder 

Definition at line 1080 of file MachineScheduler.h.

Constructor & Destructor Documentation

◆ GenericSchedulerBase()

llvm::GenericSchedulerBase::GenericSchedulerBase ( const MachineSchedContext C)
inlineprotected

Definition at line 1183 of file MachineScheduler.h.

Member Function Documentation

◆ getPolicy()

MachineSchedPolicy llvm::GenericSchedulerBase::getPolicy ( ) const
inlineoverrideprotectedvirtual

Reimplemented from llvm::MachineSchedStrategy.

Definition at line 1188 of file MachineScheduler.h.

References RegionPolicy.

◆ getReasonStr()

const char * GenericSchedulerBase::getReasonStr ( GenericSchedulerBase::CandReason  Reason)
static

◆ setPolicy()

void GenericSchedulerBase::setPolicy ( CandPolicy Policy,
bool  IsPostRA,
SchedBoundary CurrZone,
SchedBoundary OtherZone 
)
protected

◆ traceCandidate()

void GenericSchedulerBase::traceCandidate ( const SchedCandidate Cand)
protected

Member Data Documentation

◆ Context

const MachineSchedContext* llvm::GenericSchedulerBase::Context
protected

◆ RegionPolicy

MachineSchedPolicy llvm::GenericSchedulerBase::RegionPolicy
protected

◆ Rem

SchedRemainder llvm::GenericSchedulerBase::Rem
protected

◆ SchedModel

const TargetSchedModel* llvm::GenericSchedulerBase::SchedModel = nullptr
protected

◆ TRI

const TargetRegisterInfo* llvm::GenericSchedulerBase::TRI = nullptr
protected

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