23 std::unique_ptr<ScheduleHazardRecognizer> &&R) {
25 Recognizers.push_back(std::move(R));
35 for (
auto &R : Recognizers) {
36 auto res = R->getHazardType(SU, Stalls);
44 for (
auto &R : Recognizers)
49 for (
auto &R : Recognizers)
50 R->EmitInstruction(SU);
54 for (
auto &R : Recognizers)
55 R->EmitInstruction(
MI);
59 auto MN = [=](
unsigned a, std::unique_ptr<ScheduleHazardRecognizer> &R) {
60 return std::max(a, R->PreEmitNoops(SU));
62 return std::accumulate(Recognizers.begin(), Recognizers.end(), 0u, MN);
66 auto MN = [=](
unsigned a, std::unique_ptr<ScheduleHazardRecognizer> &R) {
67 return std::max(a, R->PreEmitNoops(
MI));
69 return std::accumulate(Recognizers.begin(), Recognizers.end(), 0u, MN);
73 auto SPA = [=](std::unique_ptr<ScheduleHazardRecognizer> &R) {
74 return R->ShouldPreferAnother(SU);
80 for (
auto &R : Recognizers)
85 for (
auto &R : Recognizers)
90 for (
auto &R : Recognizers)
Representation of each machine instruction.
unsigned PreEmitNoops(SUnit *) override
PreEmitNoops - This callback is invoked prior to emitting an instruction.
void EmitNoop() override
EmitNoop - This callback is invoked when a noop was added to the instruction stream.
bool atIssueLimit() const override
atIssueLimit - Return true if no more instructions may be issued in this cycle.
void AddHazardRecognizer(std::unique_ptr< ScheduleHazardRecognizer > &&)
void Reset() override
Reset - This callback is invoked when a new block of instructions is about to be schedule.
void EmitInstruction(SUnit *) override
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard stat...
HazardType getHazardType(SUnit *, int Stalls=0) override
getHazardType - Return the hazard type of emitting this node.
void RecedeCycle() override
RecedeCycle - This callback is invoked whenever the next bottom-up instruction to be scheduled cannot...
void AdvanceCycle() override
AdvanceCycle - This callback is invoked whenever the next top-down instruction to be scheduled cannot...
bool ShouldPreferAnother(SUnit *) override
ShouldPreferAnother - This callback may be invoked if getHazardType returns NoHazard.
Scheduling unit. This is a node in the scheduling DAG.
unsigned MaxLookAhead
MaxLookAhead - Indicate the number of cycles in the scoreboard state.
virtual bool atIssueLimit() const
atIssueLimit - Return true if no more instructions may be issued in this cycle.
This is an optimization pass for GlobalISel generic memory operations.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.