13 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONMACHINESCHEDULER_H 14 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONMACHINESCHEDULER_H 45 std::vector<SUnit *> Packet;
48 unsigned TotalPackets = 0;
57 assert(ResourcesModel &&
"Unimplemented CreateTargetScheduleState.");
65 delete ResourcesModel;
92 std::unique_ptr<MachineSchedStrategy> S)
97 void schedule()
override;
113 struct SchedCandidate {
123 SchedCandidate() =
default;
127 NoCand,
NodeOrder, SingleExcess, SingleCritical, SingleMax, MultiPressure,
133 struct VLIWSchedBoundary {
139 bool CheckPending =
false;
144 unsigned CurrCycle = 0;
145 unsigned IssueCount = 0;
146 unsigned CriticalPathLength = 0;
152 unsigned MaxMinLatency = 0;
157 : Available(ID, Name+
".A"),
160 ~VLIWSchedBoundary() {
161 delete ResourceModel;
180 CriticalPathLength >>= 1;
184 unsigned MaxPath = 0;
185 for (
auto &SU : DAG->
SUnits)
186 MaxPath =
std::max(MaxPath, isTop() ? SU.getHeight() : SU.getDepth());
187 CriticalPathLength =
std::max(CriticalPathLength, MaxPath) + 1;
195 bool checkHazard(
SUnit *SU);
197 void releaseNode(
SUnit *SU,
unsigned ReadyCycle);
201 void bumpNode(
SUnit *SU);
203 void releasePending();
205 void removeReady(
SUnit *SU);
207 SUnit *pickOnlyChoice();
209 bool isLatencyBound(
SUnit *SU) {
210 if (CurrCycle >= CriticalPathLength)
213 return CriticalPathLength - CurrCycle <= PathLength;
221 VLIWSchedBoundary Top;
222 VLIWSchedBoundary Bot;
225 std::vector<bool> HighPressureSets;
239 SUnit *pickNode(
bool &IsTopNode)
override;
241 void schedNode(
SUnit *SU,
bool IsTopNode)
override;
243 void releaseTopNode(
SUnit *SU)
override;
245 void releaseBottomNode(
SUnit *SU)
override;
248 return Top.ResourceModel->getTotalPackets() +
249 Bot.ResourceModel->getTotalPackets();
253 SUnit *pickNodeBidrectional(
bool &IsTopNode);
255 int pressureChange(
const SUnit *SU,
bool isBotUp);
258 SUnit *SU, SchedCandidate &Candidate,
261 CandResult pickNodeFromQueue(VLIWSchedBoundary &Zone,
263 SchedCandidate &Candidate);
275 #endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONMACHINESCHEDULER_H
VLIWResourceModel(const TargetSubtargetInfo &STI, const TargetSchedModel *SM)
This class represents lattice values for constants.
Extend the standard ScheduleDAGMI to provide more context and override the top-level schedule() drive...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
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...
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()
static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, ArrayRef< StringLiteral > StandardNames)
Initialize the set of available library functions based on the specified target triple.
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.
Align max(MaybeAlign Lhs, Align Rhs)
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.
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.