LLVM
10.0.0svn
|
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. More... | |
void | traceCandidate (const SchedCandidate &Cand) |
Protected Attributes | |
const MachineSchedContext * | Context |
const TargetSchedModel * | SchedModel = nullptr |
const TargetRegisterInfo * | TRI = nullptr |
SchedRemainder | Rem |
Additional Inherited Members | |
![]() | |
virtual | ~MachineSchedStrategy ()=default |
virtual void | initPolicy (MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, unsigned NumRegionInstrs) |
Optionally override the per-region scheduling policy. More... | |
virtual void | dumpPolicy () const |
virtual bool | shouldTrackPressure () const |
Check if pressure tracking is needed before building the DAG and initializing this strategy. More... | |
virtual bool | shouldTrackLaneMasks () const |
Returns true if lanemasks should be tracked. More... | |
virtual bool | doMBBSchedRegionsTopDown () const |
virtual void | initialize (ScheduleDAGMI *DAG)=0 |
Initialize the strategy after building the DAG for a new region. More... | |
virtual void | enterMBB (MachineBasicBlock *MBB) |
Tell the strategy that MBB is about to be processed. More... | |
virtual void | leaveMBB () |
Tell the strategy that current MBB is done. More... | |
virtual void | registerRoots () |
Notify this strategy that all roots have been released (including those that depend on EntrySU or ExitSU). More... | |
virtual SUnit * | pickNode (bool &IsTopNode)=0 |
Pick the next node to schedule, or return NULL. More... | |
virtual void | scheduleTree (unsigned SubtreeID) |
Scheduler callback to notify that a new subtree is scheduled. More... | |
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. More... | |
virtual void | releaseTopNode (SUnit *SU)=0 |
When all predecessor dependencies have been resolved, free this node for top-down scheduling. More... | |
virtual void | releaseBottomNode (SUnit *SU)=0 |
When all successor dependencies have been resolved, free this node for bottom-up scheduling. More... | |
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 785 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 789 of file MachineScheduler.h.
|
inlineprotected |
Definition at line 890 of file MachineScheduler.h.
References llvm::biasPhysReg(), llvm::getWeakLeft(), llvm::MachineSchedContext::MF, TRI, llvm::tryGreater(), llvm::tryLatency(), llvm::tryLess(), and llvm::tryPressure().
|
static |
Definition at line 2568 of file MachineScheduler.cpp.
References llvm_unreachable, llvm::NoCand, and llvm::NodeOrder.
Referenced by tracePick().
|
protected |
Set the CandPolicy given a scheduling zone given the current resources and latencies inside and outside the zone.
Definition at line 2513 of file MachineScheduler.cpp.
References llvm::SchedBoundary::Available, checkResourceLimit(), computeRemLatency(), llvm::dbgs(), llvm::GenericSchedulerBase::CandPolicy::DemandResIdx, llvm::SchedBoundary::getCurrCycle(), llvm::ReadyQueue::getName(), llvm::SchedBoundary::getOtherResourceCount(), llvm::SchedBoundary::getZoneCritResIdx(), llvm::SchedBoundary::isResourceLimited(), LLVM_DEBUG, llvm::GenericSchedulerBase::CandPolicy::ReduceLatency, and llvm::GenericSchedulerBase::CandPolicy::ReduceResIdx.
Referenced by llvm::GCNMaxOccupancySchedStrategy::initialize().
|
protected |
Definition at line 2592 of file MachineScheduler.cpp.
References llvm::RegPressureDelta::CriticalMax, llvm::RegPressureDelta::CurrentMax, llvm::dbgs(), llvm::GenericSchedulerBase::CandPolicy::DemandResIdx, llvm::RegPressureDelta::Excess, llvm::SUnit::getDepth(), llvm::SUnit::getHeight(), llvm::PressureChange::getPSet(), getReasonStr(), llvm::PressureChange::getUnitInc(), llvm::PressureChange::isValid(), llvm::Latency, llvm::SUnit::NodeNum, P, llvm::GenericSchedulerBase::SchedCandidate::Policy, llvm::GenericSchedulerBase::SchedCandidate::Reason, llvm::GenericSchedulerBase::CandPolicy::ReduceResIdx, llvm::GenericSchedulerBase::SchedCandidate::RPDelta, llvm::GenericSchedulerBase::SchedCandidate::SU, and TRI.
Referenced by llvm::GCNMaxOccupancySchedStrategy::initialize().
|
protected |
Definition at line 884 of file MachineScheduler.h.
Referenced by llvm::GCNMaxOccupancySchedStrategy::initialize().
|
protected |
Definition at line 888 of file MachineScheduler.h.
|
protected |
Definition at line 885 of file MachineScheduler.h.
Referenced by llvm::GCNMaxOccupancySchedStrategy::initialize().
|
protected |
Definition at line 886 of file MachineScheduler.h.
Referenced by llvm::GCNMaxOccupancySchedStrategy::initialize().