21 #define DEBUG_TYPE "misched"
28 for (
auto &SU : *
this) {
39 : DAG(nullptr), HazardRec(C) {}
52 if (Available.empty())
56 if (Available.size() == 1) {
59 return *Available.begin();
64 DEBUG(
dbgs() <<
"+++ Available: "; Available.dump(HazardRec););
67 for (
auto *SU : Available) {
70 Candidate c(SU, HazardRec);
73 if (Best.SU ==
nullptr || c < Best) {
77 if (Best.GroupingCost != 0)
78 dbgs() <<
"\tGrouping cost:" << Best.GroupingCost;
79 if (Best.ResourcesCost != 0)
80 dbgs() <<
" Resource cost:" << Best.ResourcesCost;
81 dbgs() <<
" Height:" << Best.SU->getHeight();
87 if (!SU->isScheduleHigh && Best.noCost())
91 assert (Best.SU !=
nullptr);
95 SystemZPostRASchedStrategy::Candidate::
112 if (GroupingCost < other.GroupingCost)
114 if (GroupingCost > other.GroupingCost)
118 if (ResourcesCost < other.ResourcesCost)
120 if (ResourcesCost > other.ResourcesCost)
124 if (SU->getHeight() > other.SU->getHeight())
126 if (SU->getHeight() < other.SU->getHeight())
130 if (SU->NodeNum < other.SU->NodeNum)
152 Available.insert(SU);
void releaseTopNode(SUnit *SU) override
SU has had all predecessor dependencies resolved.
SUnit * pickNode(bool &IsTopNode) override
Pick the next node to schedule, or return NULL.
static void dump(StringRef Title, SpillInfo const &Spills)
const MCSchedClassDesc * getSchedClass(SUnit *SU) const
Resolve and cache a resolved scheduling class for an SUnit.
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
int groupingCost(SUnit *SU) const
Return the cost of decoder grouping for SU.
void initialize(ScheduleDAGMI *dag) override
Initialize the strategy after building the DAG for a new region.
void Reset() override
Reset - This callback is invoked when a new block of instructions is about to be schedule.
SystemZHazardRecognizer maintains the state during scheduling.
void setDAG(ScheduleDAGMI *dag)
void EmitInstruction(SUnit *SU) override
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard stat...
void schedNode(SUnit *SU, bool IsTopNode) override
ScheduleDAGMI has scheduled an instruction - tell HazardRec about it.
Summarize the scheduling resources required for an instruction of a particular scheduling class...
int resourcesCost(SUnit *SU)
Return the cost of SU in regards to processor resources usage.
CHAIN = SC CHAIN, Imm128 - System call.
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
SystemZPostRASchedStrategy(const MachineSchedContext *C)
reverse_iterator rbegin(StringRef path)
Get reverse begin iterator over path.
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool operator<(int64_t V1, const APSInt &V2)
SUnit - Scheduling unit. This is a node in the scheduling DAG.
void dumpSU(SUnit *SU, raw_ostream &OS) const