14 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONMACHINESCHEDULER_H 15 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONMACHINESCHEDULER_H 46 std::vector<SUnit *> Packet;
49 unsigned TotalPackets = 0;
58 assert(ResourcesModel &&
"Unimplemented CreateTargetScheduleState.");
66 delete ResourcesModel;
93 std::unique_ptr<MachineSchedStrategy> S)
98 void schedule()
override;
114 struct SchedCandidate {
124 SchedCandidate() =
default;
128 NoCand,
NodeOrder, SingleExcess, SingleCritical, SingleMax, MultiPressure,
134 struct VLIWSchedBoundary {
140 bool CheckPending =
false;
145 unsigned CurrCycle = 0;
146 unsigned IssueCount = 0;
147 unsigned CriticalPathLength = 0;
153 unsigned MaxMinLatency = 0;
158 : Available(ID, Name+
".A"),
161 ~VLIWSchedBoundary() {
162 delete ResourceModel;
181 CriticalPathLength >>= 1;
185 unsigned MaxPath = 0;
186 for (
auto &SU : DAG->
SUnits)
187 MaxPath =
std::max(MaxPath, isTop() ? SU.getHeight() : SU.getDepth());
188 CriticalPathLength =
std::max(CriticalPathLength, MaxPath) + 1;
196 bool checkHazard(
SUnit *SU);
198 void releaseNode(
SUnit *SU,
unsigned ReadyCycle);
202 void bumpNode(
SUnit *SU);
204 void releasePending();
206 void removeReady(
SUnit *SU);
208 SUnit *pickOnlyChoice();
210 bool isLatencyBound(
SUnit *SU) {
211 if (CurrCycle >= CriticalPathLength)
214 return CriticalPathLength - CurrCycle <= PathLength;
222 VLIWSchedBoundary Top;
223 VLIWSchedBoundary Bot;
226 std::vector<bool> HighPressureSets;
240 SUnit *pickNode(
bool &IsTopNode)
override;
242 void schedNode(
SUnit *SU,
bool IsTopNode)
override;
244 void releaseTopNode(
SUnit *SU)
override;
246 void releaseBottomNode(
SUnit *SU)
override;
249 return Top.ResourceModel->getTotalPackets() +
250 Bot.ResourceModel->getTotalPackets();
254 SUnit *pickNodeBidrectional(
bool &IsTopNode);
256 int pressureChange(
const SUnit *SU,
bool isBotUp);
259 SUnit *SU, SchedCandidate &Candidate,
262 CandResult pickNodeFromQueue(VLIWSchedBoundary &Zone,
264 SchedCandidate &Candidate);
276 #endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONMACHINESCHEDULER_H
VLIWResourceModel(const TargetSubtargetInfo &STI, const TargetSchedModel *SM)
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
This class represents lattice values for constants.
Extend the standard ScheduleDAGMI to provide more context and override the top-level schedule() drive...
unsigned getDepth() const
Returns the depth of this node, which is the length of the maximum path up to any node which has no p...
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Provide an instruction scheduling machine model to CodeGen passes.
virtual DFAPacketizer * CreateTargetScheduleState(const TargetSubtargetInfo &) const
Create machine specific model for scheduling.
VLIWMachineScheduler(MachineSchedContext *C, std::unique_ptr< MachineSchedStrategy > S)
RegisterClassInfo * getRegClassInfo()
bool isInPacket(SUnit *SU) const
virtual const TargetInstrInfo * getInstrInfo() const
initializer< Ty > init(const Ty &Val)
Helpers for implementing custom MachineSchedStrategy classes.
HazardRecognizer - This determines whether or not an instruction can be issued this cycle...
Track the current register pressure at some position in the instruction stream, and remember the high...
bool reserveResources(SUnit *SU, bool IsTop)
Keep track of available resources.
ConvergingVLIWScheduler shrinks the unscheduled zone using heuristics to balance the schedule...
unsigned getTotalPackets() const
bool isResourceAvailable(SUnit *SU, bool IsTop)
Check if scheduling of this SU is possible in the current packet.
static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, ArrayRef< StringRef > StandardNames)
Initialize the set of available library functions based on the specified target triple.
TargetSubtargetInfo - Generic base class for all target subtargets.
unsigned getHeight() const
Returns the height of this node, which is the length of the maximum path down to any node which has n...
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
MachineSchedStrategy - Interface to the scheduling algorithm used by ScheduleDAGMI.
Capture a change in pressure for a single pressure set.
Store the effects of a change in pressure on things that MI scheduler cares about.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ConvergingVLIWScheduler()
unsigned getIssueWidth() const
Maximum number of micro-ops that may be scheduled per cycle.
std::vector< SUnit > SUnits
The scheduling units.
Scheduling unit. This is a node in the scheduling DAG.
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.