LLVM 20.0.0git
|
Base class for GenericScheduler. More...
#include "llvm/CodeGen/MachineScheduler.h"
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 char * | getReasonStr (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. | |
void | traceCandidate (const SchedCandidate &Cand) |
Protected Attributes | |
const MachineSchedContext * | Context |
const TargetSchedModel * | SchedModel = nullptr |
const TargetRegisterInfo * | TRI = nullptr |
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 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 SUnit * | pickNode (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. | |
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 1067 of file MachineScheduler.h.
enum llvm::GenericSchedulerBase::CandReason : uint8_t |
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 1071 of file MachineScheduler.h.
|
inlineprotected |
Definition at line 1172 of file MachineScheduler.h.
|
static |
Definition at line 3092 of file MachineScheduler.cpp.
References BotHeightReduce, BotPathReduce, Cluster, llvm_unreachable, NextDefUse, NoCand, NodeOrder, Only1, PhysReg, RegCritical, RegExcess, RegMax, ResourceDemand, ResourceReduce, Stall, TopDepthReduce, TopPathReduce, and Weak.
Referenced by traceCandidate(), and tracePick().
|
protected |
Set the CandPolicy given a scheduling zone given the current resources and latencies inside and outside the zone.
Definition at line 3037 of file MachineScheduler.cpp.
References llvm::SchedBoundary::Available, checkResourceLimit(), computeRemLatency(), llvm::SchedRemainder::CriticalPath, llvm::dbgs(), llvm::GenericSchedulerBase::CandPolicy::DemandResIdx, llvm::SchedBoundary::getCurrCycle(), llvm::TargetSchedModel::getLatencyFactor(), llvm::ReadyQueue::getName(), llvm::SchedBoundary::getOtherResourceCount(), llvm::TargetSchedModel::getResourceName(), llvm::SchedBoundary::getZoneCritResIdx(), llvm::TargetSchedModel::hasInstrSchedModel(), if(), llvm::SchedBoundary::isResourceLimited(), LLVM_DEBUG, llvm::GenericSchedulerBase::CandPolicy::ReduceLatency, llvm::GenericSchedulerBase::CandPolicy::ReduceResIdx, Rem, and SchedModel.
Referenced by llvm::PostGenericScheduler::pickNode(), llvm::GenericScheduler::pickNodeBidirectional(), llvm::PostGenericScheduler::pickNodeBidirectional(), and llvm::GCNSchedStrategy::pickNodeBidirectional().
|
protected |
Definition at line 3116 of file MachineScheduler.cpp.
References BotHeightReduce, BotPathReduce, llvm::RegPressureDelta::CriticalMax, llvm::RegPressureDelta::CurrentMax, llvm::dbgs(), llvm::GenericSchedulerBase::CandPolicy::DemandResIdx, llvm::RegPressureDelta::Excess, llvm::SUnit::getDepth(), llvm::SUnit::getHeight(), llvm::TargetSchedModel::getProcResource(), getReasonStr(), llvm::TargetRegisterInfo::getRegPressureSetName(), llvm::Latency, llvm::MCProcResourceDesc::Name, llvm::SUnit::NodeNum, P, llvm::GenericSchedulerBase::SchedCandidate::Policy, llvm::GenericSchedulerBase::SchedCandidate::Reason, llvm::GenericSchedulerBase::CandPolicy::ReduceResIdx, RegCritical, RegExcess, RegMax, ResourceDemand, ResourceReduce, llvm::GenericSchedulerBase::SchedCandidate::RPDelta, SchedModel, llvm::GenericSchedulerBase::SchedCandidate::SU, TopDepthReduce, TopPathReduce, and TRI.
Referenced by llvm::GenericScheduler::pickNodeBidirectional(), llvm::PostGenericScheduler::pickNodeBidirectional(), llvm::GCNSchedStrategy::pickNodeBidirectional(), llvm::GCNSchedStrategy::pickNodeFromQueue(), llvm::GenericScheduler::pickNodeFromQueue(), and llvm::PostGenericScheduler::pickNodeFromQueue().
|
protected |
Definition at line 1166 of file MachineScheduler.h.
Referenced by llvm::GCNSchedStrategy::initialize(), and llvm::GenericScheduler::initPolicy().
|
protected |
Definition at line 1170 of file MachineScheduler.h.
Referenced by llvm::GenericScheduler::checkAcyclicLatency(), llvm::GenericScheduler::initialize(), llvm::PostGenericScheduler::initialize(), llvm::GenericScheduler::registerRoots(), llvm::PostGenericScheduler::registerRoots(), setPolicy(), llvm::GenericScheduler::tryCandidate(), and llvm::PPCPreRASchedStrategy::tryCandidate().
|
protected |
Definition at line 1167 of file MachineScheduler.h.
Referenced by llvm::GenericScheduler::checkAcyclicLatency(), llvm::GenericScheduler::initialize(), llvm::PostGenericScheduler::initialize(), llvm::GenericSchedulerBase::SchedCandidate::initResourceDelta(), llvm::GCNSchedStrategy::pickNodeFromQueue(), llvm::GenericScheduler::pickNodeFromQueue(), llvm::PostGenericScheduler::pickNodeFromQueue(), llvm::GenericScheduler::registerRoots(), setPolicy(), traceCandidate(), llvm::GenericScheduler::tryCandidate(), llvm::GCNMaxILPSchedStrategy::tryCandidate(), and llvm::PPCPreRASchedStrategy::tryCandidate().
|
protected |
Definition at line 1168 of file MachineScheduler.h.
Referenced by llvm::GenericScheduler::initCandidate(), llvm::GenericScheduler::initialize(), llvm::PostGenericScheduler::initialize(), llvm::GCNSchedStrategy::pickNodeFromQueue(), traceCandidate(), llvm::GenericScheduler::tryCandidate(), llvm::GCNMaxILPSchedStrategy::tryCandidate(), and llvm::PPCPreRASchedStrategy::tryCandidate().