LLVM 19.0.0git
Public Member Functions | List of all members
llvm::MachineSchedStrategy Class Referenceabstract

MachineSchedStrategy - Interface to the scheduling algorithm used by ScheduleDAGMI. More...

#include "llvm/CodeGen/MachineScheduler.h"

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

Public Member Functions

virtual ~MachineSchedStrategy ()=default
 
virtual void initPolicy (MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, unsigned NumRegionInstrs)
 Optionally override the per-region scheduling policy.
 
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

MachineSchedStrategy - Interface to the scheduling algorithm used by ScheduleDAGMI.

Initialization sequence: initPolicy -> shouldTrackPressure -> initialize(DAG) -> registerRoots

Definition at line 211 of file MachineScheduler.h.

Constructor & Destructor Documentation

◆ ~MachineSchedStrategy()

virtual llvm::MachineSchedStrategy::~MachineSchedStrategy ( )
virtualdefault

Member Function Documentation

◆ doMBBSchedRegionsTopDown()

virtual bool llvm::MachineSchedStrategy::doMBBSchedRegionsTopDown ( ) const
inlinevirtual

Reimplemented in llvm::SystemZPostRASchedStrategy.

Definition at line 236 of file MachineScheduler.h.

◆ dumpPolicy()

virtual void llvm::MachineSchedStrategy::dumpPolicy ( ) const
inlinevirtual

Reimplemented in llvm::GenericScheduler.

Definition at line 222 of file MachineScheduler.h.

◆ enterMBB()

virtual void llvm::MachineSchedStrategy::enterMBB ( MachineBasicBlock MBB)
inlinevirtual

Tell the strategy that MBB is about to be processed.

Reimplemented in llvm::PPCPostRASchedStrategy, and llvm::SystemZPostRASchedStrategy.

Definition at line 242 of file MachineScheduler.h.

Referenced by llvm::PPCPostRASchedStrategy::enterMBB().

◆ initialize()

virtual void llvm::MachineSchedStrategy::initialize ( ScheduleDAGMI DAG)
pure virtual

◆ initPolicy()

virtual void llvm::MachineSchedStrategy::initPolicy ( MachineBasicBlock::iterator  Begin,
MachineBasicBlock::iterator  End,
unsigned  NumRegionInstrs 
)
inlinevirtual

Optionally override the per-region scheduling policy.

Reimplemented in llvm::GenericScheduler, llvm::PostGenericScheduler, and llvm::SystemZPostRASchedStrategy.

Definition at line 218 of file MachineScheduler.h.

◆ leaveMBB()

virtual void llvm::MachineSchedStrategy::leaveMBB ( )
inlinevirtual

Tell the strategy that current MBB is done.

Reimplemented in llvm::PPCPostRASchedStrategy, and llvm::SystemZPostRASchedStrategy.

Definition at line 245 of file MachineScheduler.h.

Referenced by llvm::PPCPostRASchedStrategy::leaveMBB().

◆ pickNode()

virtual SUnit * llvm::MachineSchedStrategy::pickNode ( bool IsTopNode)
pure virtual

Pick the next node to schedule, or return NULL.

Set IsTopNode to true to schedule the node at the top of the unscheduled region. Otherwise it will be scheduled at the bottom.

Implemented in llvm::GenericScheduler, llvm::PostGenericScheduler, llvm::ConvergingVLIWScheduler, llvm::GCNSchedStrategy, llvm::R600SchedStrategy, llvm::PPCPostRASchedStrategy, and llvm::SystemZPostRASchedStrategy.

◆ registerRoots()

virtual void llvm::MachineSchedStrategy::registerRoots ( )
inlinevirtual

Notify this strategy that all roots have been released (including those that depend on EntrySU or ExitSU).

Reimplemented in llvm::GenericScheduler, and llvm::PostGenericScheduler.

Definition at line 249 of file MachineScheduler.h.

◆ releaseBottomNode()

virtual void llvm::MachineSchedStrategy::releaseBottomNode ( SUnit SU)
pure virtual

When all successor dependencies have been resolved, free this node for bottom-up scheduling.

Implemented in llvm::GenericScheduler, llvm::PostGenericScheduler, llvm::ConvergingVLIWScheduler, llvm::R600SchedStrategy, and llvm::SystemZPostRASchedStrategy.

◆ releaseTopNode()

virtual void llvm::MachineSchedStrategy::releaseTopNode ( SUnit SU)
pure virtual

When all predecessor dependencies have been resolved, free this node for top-down scheduling.

Implemented in llvm::GenericScheduler, llvm::PostGenericScheduler, llvm::ConvergingVLIWScheduler, llvm::R600SchedStrategy, and llvm::SystemZPostRASchedStrategy.

◆ schedNode()

virtual void llvm::MachineSchedStrategy::schedNode ( SUnit SU,
bool  IsTopNode 
)
pure virtual

Notify MachineSchedStrategy that ScheduleDAGMI has scheduled an instruction and updated scheduled/remaining flags in the DAG nodes.

Implemented in llvm::GenericScheduler, llvm::PostGenericScheduler, llvm::ConvergingVLIWScheduler, llvm::R600SchedStrategy, and llvm::SystemZPostRASchedStrategy.

◆ scheduleTree()

virtual void llvm::MachineSchedStrategy::scheduleTree ( unsigned  SubtreeID)
inlinevirtual

Scheduler callback to notify that a new subtree is scheduled.

Reimplemented in llvm::PostGenericScheduler.

Definition at line 257 of file MachineScheduler.h.

◆ shouldTrackLaneMasks()

virtual bool llvm::MachineSchedStrategy::shouldTrackLaneMasks ( ) const
inlinevirtual

Returns true if lanemasks should be tracked.

LaneMask tracking is necessary to reorder independent subregister defs for the same vreg. This has to be enabled in combination with shouldTrackPressure().

Reimplemented in llvm::GenericScheduler.

Definition at line 231 of file MachineScheduler.h.

◆ shouldTrackPressure()

virtual bool llvm::MachineSchedStrategy::shouldTrackPressure ( ) const
inlinevirtual

Check if pressure tracking is needed before building the DAG and initializing this strategy.

Called after initPolicy.

Reimplemented in llvm::GenericScheduler, llvm::PostGenericScheduler, and llvm::SystemZPostRASchedStrategy.

Definition at line 226 of file MachineScheduler.h.


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