LLVM 22.0.0git
llvm::ConvergingVLIWScheduler Class Reference

#include "llvm/CodeGen/VLIWMachineScheduler.h"

Inheritance diagram for llvm::ConvergingVLIWScheduler:
[legend]

Classes

struct  SchedCandidate
 Store the state used by ConvergingVLIWScheduler heuristics, required for the lifetime of one invocation of pickNode(). More...
struct  VLIWSchedBoundary
 Each Scheduling boundary is associated with ready queues. More...

Public Types

enum  { TopQID = 1 , BotQID = 2 , LogMaxQID = 2 }
 SUnit::NodeQueueId: 0 (none), 1 (top), 2 (bot), 3 (both) More...

Public Member Functions

 ConvergingVLIWScheduler ()
virtual ~ConvergingVLIWScheduler ()=default
void initialize (ScheduleDAGMI *dag) override
 Initialize the strategy after building the DAG for a new region.
SUnitpickNode (bool &IsTopNode) override
 Pick the best node to balance the schedule. Implements MachineSchedStrategy.
void schedNode (SUnit *SU, bool IsTopNode) override
 Update the scheduler's state after scheduling a node.
void releaseTopNode (SUnit *SU) override
 When all predecessor dependencies have been resolved, free this node for top-down scheduling.
void releaseBottomNode (SUnit *SU) override
 When all successor dependencies have been resolved, free this node for bottom-up scheduling.
unsigned reportPackets ()
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 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 void scheduleTree (unsigned SubtreeID)
 Scheduler callback to notify that a new subtree is scheduled.

Protected Types

enum  CandResult {
  NoCand , NodeOrder , SingleExcess , SingleCritical ,
  SingleMax , MultiPressure , BestCost , Weak
}
 Represent the type of SchedCandidate found within a single queue. More...

Protected Member Functions

virtual VLIWResourceModelcreateVLIWResourceModel (const TargetSubtargetInfo &STI, const TargetSchedModel *SchedModel) const
SUnitpickNodeBidrectional (bool &IsTopNode)
 Pick the best candidate node from either the top or bottom queue.
int pressureChange (const SUnit *SU, bool isBotUp)
 Check if the instruction changes the register pressure of a register in the high pressure set.
virtual int SchedulingCost (ReadyQueue &Q, SUnit *SU, SchedCandidate &Candidate, RegPressureDelta &Delta, bool verbose)
 Single point to compute overall scheduling cost.
CandResult pickNodeFromQueue (VLIWSchedBoundary &Zone, const RegPressureTracker &RPTracker, SchedCandidate &Candidate)
 Pick the best candidate from the top queue.
void traceCandidate (const char *Label, const ReadyQueue &Q, SUnit *SU, int Cost, PressureChange P=PressureChange())
void readyQueueVerboseDump (const RegPressureTracker &RPTracker, SchedCandidate &Candidate, ReadyQueue &Q)

Protected Attributes

VLIWMachineSchedulerDAG = nullptr
const TargetSchedModelSchedModel = nullptr
VLIWSchedBoundary Top
VLIWSchedBoundary Bot
SmallVector< boolHighPressureSets
 List of pressure sets that have a high pressure level in the region.

Static Protected Attributes

static constexpr unsigned PriorityOne = 200
static constexpr unsigned PriorityTwo = 50
static constexpr unsigned PriorityThree = 75
static constexpr unsigned ScaleTwo = 10

Detailed Description

Definition at line 89 of file VLIWMachineScheduler.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

SUnit::NodeQueueId: 0 (none), 1 (top), 2 (bot), 3 (both)

Enumerator
TopQID 
BotQID 
LogMaxQID 

Definition at line 223 of file VLIWMachineScheduler.h.

◆ CandResult

Represent the type of SchedCandidate found within a single queue.

Enumerator
NoCand 
NodeOrder 
SingleExcess 
SingleCritical 
SingleMax 
MultiPressure 
BestCost 
Weak 

Definition at line 106 of file VLIWMachineScheduler.h.

Constructor & Destructor Documentation

◆ ConvergingVLIWScheduler()

llvm::ConvergingVLIWScheduler::ConvergingVLIWScheduler ( )
inline

◆ ~ConvergingVLIWScheduler()

virtual llvm::ConvergingVLIWScheduler::~ConvergingVLIWScheduler ( )
virtualdefault

Member Function Documentation

◆ createVLIWResourceModel()

VLIWResourceModel * ConvergingVLIWScheduler::createVLIWResourceModel ( const TargetSubtargetInfo & STI,
const TargetSchedModel * SchedModel ) const
protectedvirtual

Reimplemented in llvm::HexagonConvergingVLIWScheduler.

Definition at line 302 of file VLIWMachineScheduler.cpp.

References SchedModel.

Referenced by initialize().

◆ initialize()

void ConvergingVLIWScheduler::initialize ( ScheduleDAGMI * DAG)
overridevirtual

Initialize the strategy after building the DAG for a new region.

Implements llvm::MachineSchedStrategy.

Definition at line 270 of file VLIWMachineScheduler.cpp.

References Bot, createVLIWResourceModel(), DAG, llvm::TargetSubtargetInfo::getInstrInfo(), HighPressureSets, RPThreshold, SchedModel, TII, and Top.

◆ pickNode()

◆ pickNodeBidrectional()

SUnit * ConvergingVLIWScheduler::pickNodeBidrectional ( bool & IsTopNode)
protected

◆ pickNodeFromQueue()

◆ pressureChange()

int ConvergingVLIWScheduler::pressureChange ( const SUnit * SU,
bool isBotUp )
protected

Check if the instruction changes the register pressure of a register in the high pressure set.

The function returns a negative value if the pressure decreases and a positive value is the pressure increases. If the instruction doesn't use a high pressure register or doesn't change the register pressure, then return 0.

Definition at line 577 of file VLIWMachineScheduler.cpp.

References DAG, HighPressureSets, and P.

Referenced by SchedulingCost().

◆ readyQueueVerboseDump()

void ConvergingVLIWScheduler::readyQueueVerboseDump ( const RegPressureTracker & RPTracker,
SchedCandidate & Candidate,
ReadyQueue & Q )
protected

◆ releaseBottomNode()

void ConvergingVLIWScheduler::releaseBottomNode ( SUnit * SU)
overridevirtual

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

Implements llvm::MachineSchedStrategy.

Definition at line 322 of file VLIWMachineScheduler.cpp.

References assert(), Bot, llvm::SUnit::BotReadyCycle, llvm::SUnit::getInstr(), I, llvm::SUnit::isScheduled, and llvm::SUnit::Succs.

◆ releaseTopNode()

void ConvergingVLIWScheduler::releaseTopNode ( SUnit * SU)
overridevirtual

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

Implements llvm::MachineSchedStrategy.

Definition at line 307 of file VLIWMachineScheduler.cpp.

References llvm::SDep::getLatency(), llvm::SDep::getSUnit(), llvm::SUnit::isScheduled, llvm::SUnit::Preds, Top, and llvm::SUnit::TopReadyCycle.

◆ reportPackets()

unsigned llvm::ConvergingVLIWScheduler::reportPackets ( )
inline

Definition at line 238 of file VLIWMachineScheduler.h.

References Bot, and Top.

Referenced by pickNode().

◆ schedNode()

void ConvergingVLIWScheduler::schedNode ( SUnit * SU,
bool IsTopNode )
overridevirtual

Update the scheduler's state after scheduling a node.

This is the same node that was just returned by pickNode(). However, VLIWMachineScheduler needs to update it's state based on the current cycle before MachineSchedStrategy does.

Implements llvm::MachineSchedStrategy.

Definition at line 996 of file VLIWMachineScheduler.cpp.

References Bot, llvm::SUnit::BotReadyCycle, Top, and llvm::SUnit::TopReadyCycle.

◆ SchedulingCost()

◆ traceCandidate()

void ConvergingVLIWScheduler::traceCandidate ( const char * Label,
const ReadyQueue & Q,
SUnit * SU,
int Cost,
PressureChange P = PressureChange() )
protected

Definition at line 507 of file VLIWMachineScheduler.cpp.

References DAG, llvm::dbgs(), llvm::ReadyQueue::getName(), and P.

Referenced by pickNodeFromQueue().

Member Data Documentation

◆ Bot

◆ DAG

◆ HighPressureSets

SmallVector<bool> llvm::ConvergingVLIWScheduler::HighPressureSets
protected

List of pressure sets that have a high pressure level in the region.

Definition at line 219 of file VLIWMachineScheduler.h.

Referenced by initialize(), and pressureChange().

◆ PriorityOne

unsigned llvm::ConvergingVLIWScheduler::PriorityOne = 200
staticconstexprprotected

Definition at line 119 of file VLIWMachineScheduler.h.

Referenced by SchedulingCost().

◆ PriorityThree

unsigned llvm::ConvergingVLIWScheduler::PriorityThree = 75
staticconstexprprotected

Definition at line 121 of file VLIWMachineScheduler.h.

Referenced by SchedulingCost().

◆ PriorityTwo

unsigned llvm::ConvergingVLIWScheduler::PriorityTwo = 50
staticconstexprprotected

◆ ScaleTwo

unsigned llvm::ConvergingVLIWScheduler::ScaleTwo = 10
staticconstexprprotected

Definition at line 122 of file VLIWMachineScheduler.h.

Referenced by SchedulingCost().

◆ SchedModel

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

◆ Top


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