LLVM API Documentation

Public Member Functions | Protected Member Functions
llvm::GenericScheduler Class Reference

#include <MachineScheduler.h>

Inheritance diagram for llvm::GenericScheduler:
Inheritance graph
[legend]
Collaboration diagram for llvm::GenericScheduler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GenericScheduler (const MachineSchedContext *C)
void initPolicy (MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, unsigned NumRegionInstrs) override
 Initialize the per-region scheduling policy.
bool shouldTrackPressure () const override
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
void releaseTopNode (SUnit *SU) override
void releaseBottomNode (SUnit *SU) override
void registerRoots () override

Protected Member Functions

void checkAcyclicLatency ()
void tryCandidate (SchedCandidate &Cand, SchedCandidate &TryCand, SchedBoundary &Zone, const RegPressureTracker &RPTracker, RegPressureTracker &TempTracker)
SUnitpickNodeBidirectional (bool &IsTopNode)
 Pick the best candidate node from either the top or bottom queue.
void pickNodeFromQueue (SchedBoundary &Zone, const RegPressureTracker &RPTracker, SchedCandidate &Candidate)
void reschedulePhysRegCopies (SUnit *SU, bool isTop)

Detailed Description

GenericScheduler shrinks the unscheduled zone using heuristics to balance the schedule.

Definition at line 845 of file MachineScheduler.h.


Constructor & Destructor Documentation

Definition at line 854 of file MachineScheduler.h.


Member Function Documentation

Set IsAcyclicLatencyLimited if the acyclic path is longer than the cyclic critical path by more cycles than it takes to drain the instruction buffer. We estimate an upper bounds on in-flight instructions as:

CyclesPerIteration = max( CyclicPath, Loop-Resource-Height ) InFlightIterations = AcyclicPath / CyclesPerIteration InFlightResources = InFlightIterations * LoopResources

TODO: Check execution resources in addition to IssueCount.

Definition at line 2436 of file MachineScheduler.cpp.

References llvm::SchedRemainder::CriticalPath, llvm::SchedRemainder::CyclicCritPath, llvm::dbgs(), DEBUG, llvm::TargetSchedModel::getLatencyFactor(), llvm::TargetSchedModel::getMicroOpBufferSize(), llvm::TargetSchedModel::getMicroOpFactor(), llvm::SchedRemainder::IsAcyclicLatencyLimited, llvm::GenericSchedulerBase::Rem, llvm::SchedRemainder::RemIssueCount, and llvm::GenericSchedulerBase::SchedModel.

void GenericScheduler::initialize ( ScheduleDAGMI DAG) [override, virtual]
void GenericScheduler::initPolicy ( MachineBasicBlock::iterator  Begin,
MachineBasicBlock::iterator  End,
unsigned  NumRegionInstrs 
) [override, virtual]
SUnit * GenericScheduler::pickNode ( bool IsTopNode) [override, virtual]
SUnit * GenericScheduler::pickNodeBidirectional ( bool IsTopNode) [protected]
void GenericScheduler::pickNodeFromQueue ( SchedBoundary Zone,
const RegPressureTracker RPTracker,
SchedCandidate Cand 
) [protected]
void GenericScheduler::registerRoots ( ) [override, virtual]

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

Reimplemented from llvm::MachineSchedStrategy.

Definition at line 2464 of file MachineScheduler.cpp.

References llvm::SchedRemainder::CriticalPath, llvm::SchedRemainder::CyclicCritPath, llvm::dbgs(), DEBUG, llvm::DumpCriticalPathLength, EnableCyclicPath, llvm::errs(), llvm::ScheduleDAG::ExitSU, llvm::SUnit::getDepth(), I, and llvm::GenericSchedulerBase::Rem.

void llvm::GenericScheduler::releaseBottomNode ( SUnit SU) [inline, override, virtual]

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

Implements llvm::MachineSchedStrategy.

Definition at line 876 of file MachineScheduler.h.

References llvm::SchedBoundary::releaseBottomNode().

void llvm::GenericScheduler::releaseTopNode ( SUnit SU) [inline, override, virtual]

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

Implements llvm::MachineSchedStrategy.

Definition at line 872 of file MachineScheduler.h.

References llvm::SchedBoundary::releaseTopNode().

void GenericScheduler::reschedulePhysRegCopies ( SUnit SU,
bool  isTop 
) [protected]
void GenericScheduler::schedNode ( SUnit SU,
bool  IsTopNode 
) [override, virtual]

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

FIXME: Eventually, we may bundle physreg copies rather than rescheduling them here. See comments in biasPhysRegCopy.

Implements llvm::MachineSchedStrategy.

Definition at line 2849 of file MachineScheduler.cpp.

References llvm::SUnit::BotReadyCycle, llvm::SUnit::hasPhysRegDefs, llvm::SUnit::hasPhysRegUses, and llvm::SUnit::TopReadyCycle.

bool llvm::GenericScheduler::shouldTrackPressure ( ) const [inline, override, virtual]

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

Reimplemented from llvm::MachineSchedStrategy.

Definition at line 862 of file MachineScheduler.h.

References llvm::MachineSchedPolicy::ShouldTrackPressure.

void GenericScheduler::tryCandidate ( SchedCandidate Cand,
SchedCandidate TryCand,
SchedBoundary Zone,
const RegPressureTracker RPTracker,
RegPressureTracker TempTracker 
) [protected]

Apply a set of heursitics to a new candidate. Heuristics are currently hierarchical. This may be more efficient than a graduated cost model because we don't need to evaluate all aspects of the model for each node in the queue. But it's really done to make the heuristics easier to debug and statistically analyze.

Parameters:
Candprovides the policy and current best candidate.
TryCandrefers to the next SUnit candidate, otherwise uninitialized.
Zonedescribes the scheduled zone that we are extending.
RPTrackerdescribes reg pressure within the scheduled zone.
TempTrackeris a scratch pressure tracker to reuse in queries.

Definition at line 2551 of file MachineScheduler.cpp.

References biasPhysRegCopy(), llvm::GenericSchedulerBase::Cluster, llvm::RegPressureDelta::CriticalMax, llvm::GenericSchedulerBase::SchedResourceDelta::CritResources, llvm::RegPressureDelta::CurrentMax, llvm::dbgs(), DEBUG, llvm::GenericSchedulerBase::SchedResourceDelta::DemandedResources, llvm::RegPressureDelta::Excess, llvm::SchedBoundary::getCurrMOps(), llvm::SUnit::getInstr(), llvm::SchedBoundary::getLatencyStallCycles(), llvm::RegPressureTracker::getMaxDownwardPressureDelta(), llvm::RegPressureTracker::getMaxUpwardPressureDelta(), llvm::ScheduleDAGMI::getNextClusterPred(), llvm::ScheduleDAGMI::getNextClusterSucc(), llvm::PressureChange::getPSet(), llvm::TargetRegisterInfo::getRegPressureSetName(), llvm::PressureChange::getUnitInc(), llvm::RegPressureTracker::getUpwardPressureDelta(), getWeakLeft(), llvm::GenericSchedulerBase::SchedCandidate::initResourceDelta(), llvm::SchedRemainder::IsAcyclicLatencyLimited, llvm::SchedBoundary::isNextSU(), llvm::SchedBoundary::isTop(), llvm::PressureChange::isValid(), llvm::GenericSchedulerBase::SchedCandidate::isValid(), llvm::GenericSchedulerBase::NextDefUse, llvm::SUnit::NodeNum, llvm::GenericSchedulerBase::NodeOrder, llvm::GenericSchedulerBase::PhysRegCopy, llvm::GenericSchedulerBase::SchedCandidate::Reason, llvm::GenericSchedulerBase::RegCritical, llvm::GenericSchedulerBase::RegExcess, llvm::GenericSchedulerBase::RegMax, llvm::GenericSchedulerBase::Rem, llvm::GenericSchedulerBase::SchedCandidate::ResDelta, llvm::GenericSchedulerBase::ResourceDemand, llvm::GenericSchedulerBase::ResourceReduce, llvm::GenericSchedulerBase::SchedCandidate::RPDelta, llvm::GenericSchedulerBase::SchedModel, llvm::GenericSchedulerBase::Stall, llvm::GenericSchedulerBase::SchedCandidate::SU, llvm::GenericSchedulerBase::TRI, tryGreater(), tryLatency(), tryLess(), tryPressure(), VerifyScheduling, and llvm::GenericSchedulerBase::Weak.


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