LLVM API Documentation
#include <HexagonMachineScheduler.h>
Classes | |
struct | SchedCandidate |
struct | VLIWSchedBoundary |
Public Types | |
enum | { TopQID = 1, BotQID = 2, LogMaxQID = 2 } |
SUnit::NodeQueueId: 0 (none), 1 (top), 2 (bot), 3 (both) More... | |
Public Member Functions | |
ConvergingVLIWScheduler () | |
void | initialize (ScheduleDAGMI *dag) override |
Initialize the strategy after building the DAG for a new region. | |
SUnit * | pickNode (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 |
unsigned | ReportPackets () |
Protected Member Functions | |
SUnit * | pickNodeBidrectional (bool &IsTopNode) |
Pick the best candidate node from either the top or bottom queue. | |
int | SchedulingCost (ReadyQueue &Q, SUnit *SU, SchedCandidate &Candidate, RegPressureDelta &Delta, bool verbose) |
CandResult | pickNodeFromQueue (ReadyQueue &Q, const RegPressureTracker &RPTracker, SchedCandidate &Candidate) |
void | traceCandidate (const char *Label, const ReadyQueue &Q, SUnit *SU, PressureChange P=PressureChange()) |
ConvergingVLIWScheduler shrinks the unscheduled zone using heuristics to balance the schedule.
Definition at line 111 of file HexagonMachineScheduler.h.
anonymous enum |
SUnit::NodeQueueId: 0 (none), 1 (top), 2 (bot), 3 (both)
Definition at line 202 of file HexagonMachineScheduler.h.
Definition at line 208 of file HexagonMachineScheduler.h.
void ConvergingVLIWScheduler::initialize | ( | ScheduleDAGMI * | DAG | ) | [override, virtual] |
Initialize the strategy after building the DAG for a new region.
Implements llvm::MachineSchedStrategy.
Definition at line 198 of file HexagonMachineScheduler.cpp.
References llvm::TargetInstrInfo::CreateTargetMIHazardRecognizer(), llvm::ForceBottomUp, llvm::ForceTopDown, llvm::TargetSubtargetInfo::getInstrInfo(), llvm::TargetSchedModel::getInstrItineraries(), llvm::ScheduleDAGInstrs::getSchedModel(), llvm::TargetMachine::getSubtargetImpl(), llvm::MachineFunction::getTarget(), llvm::ScheduleDAG::MF, and llvm::SystemZISD::TM.
SUnit * ConvergingVLIWScheduler::pickNode | ( | bool & | IsTopNode | ) | [override, virtual] |
Pick the best node to balance the schedule. Implements MachineSchedStrategy.
Implements llvm::MachineSchedStrategy.
Definition at line 642 of file HexagonMachineScheduler.cpp.
References llvm::ScheduleDAGMI::bottom(), llvm::dbgs(), DEBUG, llvm::SUnit::dump(), llvm::ForceBottomUp, llvm::ForceTopDown, llvm::ScheduleDAGMILive::getBotRPTracker(), llvm::ScheduleDAGMILive::getTopRPTracker(), llvm::SUnit::isBottomReady(), llvm::SUnit::isTopReady(), pickNodeBidrectional(), pickNodeFromQueue(), and llvm::ScheduleDAGMI::top().
SUnit * ConvergingVLIWScheduler::pickNodeBidrectional | ( | bool & | IsTopNode | ) | [protected] |
Pick the best candidate node from either the top or bottom queue.
Definition at line 584 of file HexagonMachineScheduler.cpp.
References llvm::ScheduleDAGMILive::getBotRPTracker(), llvm::ScheduleDAGMILive::getTopRPTracker(), and pickNodeFromQueue().
Referenced by pickNode().
ConvergingVLIWScheduler::CandResult ConvergingVLIWScheduler::pickNodeFromQueue | ( | ReadyQueue & | Q, |
const RegPressureTracker & | RPTracker, | ||
SchedCandidate & | Candidate | ||
) | [protected] |
Pick the best candidate from the top queue.
TODO: getMaxPressureDelta results can be mostly cached for each SUnit during DAG building. To adjust for the current scheduling location we need to maintain the number of vreg uses remaining to be top-scheduled.
Definition at line 539 of file HexagonMachineScheduler.cpp.
References llvm::ReadyQueue::begin(), DEBUG, llvm::ReadyQueue::dump(), llvm::ReadyQueue::end(), llvm::ScheduleDAGMILive::getRegionCriticalPSets(), llvm::ScheduleDAGMILive::getRegPressure(), I, llvm::RegisterPressure::MaxSetPressure, SchedulingCost(), and traceCandidate().
Referenced by pickNode(), and pickNodeBidrectional().
void ConvergingVLIWScheduler::releaseBottomNode | ( | SUnit * | SU | ) | [override, virtual] |
When all successor dependencies have been resolved, free this node for bottom-up scheduling.
Implements llvm::MachineSchedStrategy.
Definition at line 244 of file HexagonMachineScheduler.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SUnit::BotReadyCycle, llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::SUnit::getInstr(), I, llvm::SUnit::isScheduled, and llvm::SUnit::Succs.
void ConvergingVLIWScheduler::releaseTopNode | ( | SUnit * | SU | ) | [override, virtual] |
When all predecessor dependencies have been resolved, free this node for top-down scheduling.
Implements llvm::MachineSchedStrategy.
Definition at line 227 of file HexagonMachineScheduler.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), I, llvm::SUnit::isScheduled, llvm::SUnit::Preds, and llvm::SUnit::TopReadyCycle.
unsigned llvm::ConvergingVLIWScheduler::ReportPackets | ( | ) | [inline] |
Definition at line 222 of file HexagonMachineScheduler.h.
void ConvergingVLIWScheduler::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, VLIWMachineScheduler needs to update it's state based on the current cycle before MachineSchedStrategy does.
Implements llvm::MachineSchedStrategy.
Definition at line 690 of file HexagonMachineScheduler.cpp.
References llvm::SUnit::BotReadyCycle, and llvm::SUnit::TopReadyCycle.
int ConvergingVLIWScheduler::SchedulingCost | ( | ReadyQueue & | Q, |
SUnit * | SU, | ||
SchedCandidate & | Candidate, | ||
RegPressureDelta & | Delta, | ||
bool | verbose | ||
) | [protected] |
Single point to compute overall scheduling cost. TODO: More heuristics will be used soon.
Definition at line 473 of file HexagonMachineScheduler.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::RegPressureDelta::CriticalMax, llvm::dbgs(), DEBUG, llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::RegPressureDelta::Excess, FactorOne, llvm::SUnit::getDepth(), llvm::SUnit::getHeight(), llvm::ReadyQueue::getID(), getSingleUnscheduledPred(), getSingleUnscheduledSucc(), llvm::PressureChange::getUnitInc(), I, llvm::SUnit::isScheduled, llvm::SUnit::isScheduleHigh, llvm::SUnit::Preds, PriorityOne, PriorityTwo, ScaleTwo, llvm::SUnit::Succs, and TopQID.
Referenced by pickNodeFromQueue().
void ConvergingVLIWScheduler::traceCandidate | ( | const char * | Label, |
const ReadyQueue & | Q, | ||
SUnit * | SU, | ||
PressureChange | P = PressureChange() |
||
) | [protected] |
Definition at line 415 of file HexagonMachineScheduler.cpp.
References llvm::dbgs(), llvm::SUnit::dump(), llvm::ReadyQueue::getName(), llvm::PressureChange::getPSet(), llvm::TargetRegisterInfo::getRegPressureSetName(), llvm::PressureChange::getUnitInc(), llvm::PressureChange::isValid(), and llvm::ScheduleDAG::TRI.
Referenced by pickNodeFromQueue().