|
LLVM
4.0.0
|
ConvergingVLIWScheduler shrinks the unscheduled zone using heuristics to balance the schedule. More...
#include <HexagonMachineScheduler.h>
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. More... | |
| SUnit * | pickNode (bool &IsTopNode) override |
| Pick the best node to balance the schedule. Implements MachineSchedStrategy. More... | |
| void | schedNode (SUnit *SU, bool IsTopNode) override |
| Update the scheduler's state after scheduling a node. More... | |
| void | releaseTopNode (SUnit *SU) override |
| When all predecessor dependencies have been resolved, free this node for top-down scheduling. More... | |
| void | releaseBottomNode (SUnit *SU) override |
| When all successor dependencies have been resolved, free this node for bottom-up scheduling. More... | |
| unsigned | ReportPackets () |
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. More... | |
| virtual void | dumpPolicy () |
| 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 void | registerRoots () |
| Notify this strategy that all roots have been released (including those that depend on EntrySU or ExitSU). More... | |
| virtual void | scheduleTree (unsigned SubtreeID) |
| Scheduler callback to notify that a new subtree is scheduled. More... | |
Protected Member Functions | |
| SUnit * | pickNodeBidrectional (bool &IsTopNode) |
| Pick the best candidate node from either the top or bottom queue. More... | |
| int | SchedulingCost (ReadyQueue &Q, SUnit *SU, SchedCandidate &Candidate, RegPressureDelta &Delta, bool verbose) |
| Single point to compute overall scheduling cost. More... | |
| CandResult | pickNodeFromQueue (ReadyQueue &Q, const RegPressureTracker &RPTracker, SchedCandidate &Candidate) |
| Pick the best candidate from the top queue. More... | |
| void | traceCandidate (const char *Label, const ReadyQueue &Q, SUnit *SU, int Cost, PressureChange P=PressureChange()) |
| void | readyQueueVerboseDump (const RegPressureTracker &RPTracker, SchedCandidate &Candidate, ReadyQueue &Q) |
ConvergingVLIWScheduler shrinks the unscheduled zone using heuristics to balance the schedule.
Definition at line 115 of file HexagonMachineScheduler.h.
| anonymous enum |
SUnit::NodeQueueId: 0 (none), 1 (top), 2 (bot), 3 (both)
| Enumerator | |
|---|---|
| TopQID | |
| BotQID | |
| LogMaxQID | |
Definition at line 207 of file HexagonMachineScheduler.h.
|
inline |
Definition at line 213 of file HexagonMachineScheduler.h.
|
overridevirtual |
Initialize the strategy after building the DAG for a new region.
Implements llvm::MachineSchedStrategy.
Definition at line 313 of file HexagonMachineScheduler.cpp.
References assert(), llvm::TargetInstrInfo::CreateTargetMIHazardRecognizer(), llvm::ForceBottomUp, llvm::ForceTopDown, llvm::TargetSubtargetInfo::getInstrInfo(), llvm::TargetSchedModel::getInstrItineraries(), llvm::ScheduleDAGInstrs::getSchedModel(), llvm::MachineFunction::getSubtarget(), llvm::ScheduleDAG::MF, and TII.
Pick the best node to balance the schedule. Implements MachineSchedStrategy.
Implements llvm::MachineSchedStrategy.
Definition at line 975 of file HexagonMachineScheduler.cpp.
References assert(), llvm::dbgs(), DEBUG, llvm::SUnit::dump(), llvm::ForceBottomUp, llvm::ForceTopDown, llvm::SUnit::isBottomReady(), llvm::SUnit::isTopReady(), pickNodeBidrectional(), and pickNodeFromQueue().
Pick the best candidate node from either the top or bottom queue.
Definition at line 909 of file HexagonMachineScheduler.cpp.
References assert(), llvm::dbgs(), DEBUG, and pickNodeFromQueue().
Referenced by pickNode().
|
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 798 of file HexagonMachineScheduler.cpp.
References llvm::ReadyQueue::begin(), BotQID, BotUseShorterTie, llvm::dbgs(), DEBUG, DisableTCTie, llvm::ReadyQueue::dump(), E, llvm::ReadyQueue::end(), llvm::ReadyQueue::getID(), llvm::HexagonSubtarget::getInstrInfo(), llvm::MachineFunction::getSubtarget(), I, llvm::ScheduleDAG::MF, readyQueueVerboseDump(), SchedDebugVerboseLevel, SchedulingCost(), TopQID, TopUseShorterTie, and traceCandidate().
Referenced by pickNode(), and pickNodeBidrectional().
|
protected |
Definition at line 542 of file HexagonMachineScheduler.cpp.
References llvm::ReadyQueue::begin(), llvm::dbgs(), E, llvm::ReadyQueue::end(), llvm::RegPressureTracker::getMaxPressureDelta(), llvm::ReadyQueue::getName(), I, and SchedulingCost().
Referenced by pickNodeFromQueue().
|
overridevirtual |
When all successor dependencies have been resolved, free this node for bottom-up scheduling.
Implements llvm::MachineSchedStrategy.
Definition at line 358 of file HexagonMachineScheduler.cpp.
References assert(), llvm::SUnit::BotReadyCycle, E, llvm::SUnit::getInstr(), I, llvm::SUnit::isScheduled, and llvm::SUnit::Succs.
|
overridevirtual |
When all predecessor dependencies have been resolved, free this node for top-down scheduling.
Implements llvm::MachineSchedStrategy.
Definition at line 342 of file HexagonMachineScheduler.cpp.
References llvm::SDep::getLatency(), llvm::SDep::getSUnit(), llvm::SUnit::isScheduled, llvm::SUnit::Preds, and llvm::SUnit::TopReadyCycle.
|
inline |
Definition at line 227 of file HexagonMachineScheduler.h.
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 1023 of file HexagonMachineScheduler.cpp.
References llvm::SUnit::BotReadyCycle, and llvm::SUnit::TopReadyCycle.
|
protected |
Single point to compute overall scheduling cost.
TODO: More heuristics will be used soon.
Definition at line 610 of file HexagonMachineScheduler.cpp.
References BotQID, CheckEarlyAvail, llvm::RegPressureDelta::CriticalMax, llvm::RegPressureDelta::CurrentMax, llvm::dbgs(), DEBUG, llvm::RegPressureDelta::Excess, FactorOne, llvm::SUnit::getDepth(), llvm::SUnit::getHeight(), llvm::ReadyQueue::getID(), llvm::SUnit::getInstr(), llvm::HexagonSubtarget::getInstrInfo(), llvm::SDep::getLatency(), getSingleUnscheduledPred(), getSingleUnscheduledSucc(), llvm::MachineFunction::getSubtarget(), llvm::SDep::getSUnit(), llvm::PressureChange::getUnitInc(), IgnoreBBRegPressure, llvm::SDep::isAssignedRegDep(), llvm::SUnit::isInstr(), llvm::MachineInstr::isPseudo(), llvm::SUnit::isScheduled, llvm::SUnit::isScheduleHigh, llvm::ScheduleDAG::MF, llvm::SUnit::Preds, PriorityOne, PriorityThree, PriorityTwo, ScaleTwo, SI, llvm::SUnit::Succs, and TopQID.
Referenced by pickNodeFromQueue(), and readyQueueVerboseDump().
|
protected |
Definition at line 529 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().
1.8.6