LLVM API Documentation
#include <MachineScheduler.h>
Public Member Functions | |
PostGenericScheduler (const MachineSchedContext *C) | |
virtual | ~PostGenericScheduler () |
void | initPolicy (MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, unsigned NumRegionInstrs) override |
Optionally override the per-region scheduling policy. | |
bool | shouldTrackPressure () const override |
PostRA scheduling does not track pressure. | |
void | initialize (ScheduleDAGMI *Dag) override |
Initialize the strategy after building the DAG for a new region. | |
void | registerRoots () override |
SUnit * | pickNode (bool &IsTopNode) override |
Pick the next node to schedule. | |
void | scheduleTree (unsigned SubtreeID) override |
Scheduler callback to notify that a new subtree is scheduled. | |
void | schedNode (SUnit *SU, bool IsTopNode) override |
void | releaseTopNode (SUnit *SU) override |
void | releaseBottomNode (SUnit *SU) override |
Protected Member Functions | |
void | tryCandidate (SchedCandidate &Cand, SchedCandidate &TryCand) |
void | pickNodeFromQueue (SchedCandidate &Cand) |
PostGenericScheduler - Interface to the scheduling algorithm used by ScheduleDAGMI.
Callbacks from ScheduleDAGMI: initPolicy -> initialize(DAG) -> registerRoots -> pickNode ...
Definition at line 905 of file MachineScheduler.h.
llvm::PostGenericScheduler::PostGenericScheduler | ( | const MachineSchedContext * | C | ) | [inline] |
Definition at line 910 of file MachineScheduler.h.
virtual llvm::PostGenericScheduler::~PostGenericScheduler | ( | ) | [inline, virtual] |
Definition at line 913 of file MachineScheduler.h.
void PostGenericScheduler::initialize | ( | ScheduleDAGMI * | DAG | ) | [override, virtual] |
Initialize the strategy after building the DAG for a new region.
Implements llvm::MachineSchedStrategy.
Definition at line 2889 of file MachineScheduler.cpp.
References llvm::TargetInstrInfo::CreateTargetMIHazardRecognizer(), llvm::tgtok::Dag, llvm::TargetSubtargetInfo::getInstrInfo(), llvm::TargetSchedModel::getInstrItineraries(), llvm::ScheduleDAGInstrs::getSchedModel(), llvm::TargetMachine::getSubtargetImpl(), llvm::MachineFunction::getTarget(), llvm::SchedRemainder::init(), llvm::ScheduleDAG::MF, llvm::GenericSchedulerBase::Rem, llvm::GenericSchedulerBase::SchedModel, llvm::SystemZISD::TM, llvm::ScheduleDAG::TRI, and llvm::GenericSchedulerBase::TRI.
void llvm::PostGenericScheduler::initPolicy | ( | MachineBasicBlock::iterator | Begin, |
MachineBasicBlock::iterator | End, | ||
unsigned | NumRegionInstrs | ||
) | [inline, override, virtual] |
Optionally override the per-region scheduling policy.
Reimplemented from llvm::MachineSchedStrategy.
Definition at line 915 of file MachineScheduler.h.
SUnit * PostGenericScheduler::pickNode | ( | bool & | IsTopNode | ) | [override, virtual] |
Pick the next node to schedule.
Implements llvm::MachineSchedStrategy.
Definition at line 2980 of file MachineScheduler.cpp.
References llvm::ScheduleDAGMI::bottom(), llvm::dbgs(), DEBUG, llvm::SUnit::getInstr(), llvm::SUnit::isScheduled, llvm::GenericSchedulerBase::NoCand, llvm::SUnit::NodeNum, llvm::GenericSchedulerBase::SchedCandidate::Policy, llvm::GenericSchedulerBase::SchedCandidate::Reason, llvm::GenericSchedulerBase::setPolicy(), llvm::GenericSchedulerBase::SchedCandidate::SU, llvm::ScheduleDAGMI::top(), and tracePick().
void PostGenericScheduler::pickNodeFromQueue | ( | SchedCandidate & | Cand | ) | [protected] |
Definition at line 2962 of file MachineScheduler.cpp.
References llvm::ReadyQueue::begin(), DEBUG, llvm::ReadyQueue::dump(), llvm::ReadyQueue::end(), I, llvm::GenericSchedulerBase::SchedCandidate::initResourceDelta(), llvm::GenericSchedulerBase::NoCand, llvm::GenericSchedulerBase::SchedCandidate::Policy, llvm::GenericSchedulerBase::SchedCandidate::Reason, llvm::GenericSchedulerBase::SchedModel, llvm::GenericSchedulerBase::SchedCandidate::setBest(), llvm::GenericSchedulerBase::SchedCandidate::SU, and llvm::GenericSchedulerBase::traceCandidate().
void PostGenericScheduler::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 2910 of file MachineScheduler.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SchedRemainder::CriticalPath, llvm::dbgs(), DEBUG, llvm::DumpCriticalPathLength, llvm::errs(), llvm::ScheduleDAG::ExitSU, llvm::SUnit::getDepth(), I, and llvm::GenericSchedulerBase::Rem.
void llvm::PostGenericScheduler::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 941 of file MachineScheduler.h.
References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
void llvm::PostGenericScheduler::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 936 of file MachineScheduler.h.
References llvm::SchedBoundary::releaseTopNode().
void PostGenericScheduler::schedNode | ( | SUnit * | SU, |
bool | IsTopNode | ||
) | [override, virtual] |
Called after ScheduleDAGMI has scheduled an instruction and updated scheduled/remaining flags in the DAG nodes.
Implements llvm::MachineSchedStrategy.
Definition at line 3010 of file MachineScheduler.cpp.
References llvm::SUnit::TopReadyCycle.
void llvm::PostGenericScheduler::scheduleTree | ( | unsigned | SubtreeID | ) | [inline, override, virtual] |
Scheduler callback to notify that a new subtree is scheduled.
Reimplemented from llvm::MachineSchedStrategy.
Definition at line 930 of file MachineScheduler.h.
References llvm_unreachable.
bool llvm::PostGenericScheduler::shouldTrackPressure | ( | ) | const [inline, override, virtual] |
PostRA scheduling does not track pressure.
Reimplemented from llvm::MachineSchedStrategy.
Definition at line 922 of file MachineScheduler.h.
void PostGenericScheduler::tryCandidate | ( | SchedCandidate & | Cand, |
SchedCandidate & | TryCand | ||
) | [protected] |
Apply a set of heursitics to a new candidate for PostRA scheduling.
Cand | provides the policy and current best candidate. |
TryCand | refers to the next SUnit candidate, otherwise uninitialized. |
Definition at line 2929 of file MachineScheduler.cpp.
References llvm::GenericSchedulerBase::SchedResourceDelta::CritResources, llvm::GenericSchedulerBase::SchedResourceDelta::DemandedResources, llvm::GenericSchedulerBase::SchedCandidate::isValid(), llvm::SUnit::NodeNum, llvm::GenericSchedulerBase::NodeOrder, llvm::GenericSchedulerBase::SchedCandidate::Reason, llvm::GenericSchedulerBase::SchedCandidate::ResDelta, llvm::GenericSchedulerBase::ResourceDemand, llvm::GenericSchedulerBase::ResourceReduce, llvm::GenericSchedulerBase::Stall, llvm::GenericSchedulerBase::SchedCandidate::SU, tryGreater(), tryLatency(), and tryLess().