LLVM 20.0.0git
|
HazardRecognizer - This determines whether or not an instruction can be issued this cycle, and whether or not a noop needs to be inserted to handle the hazard. More...
#include "llvm/CodeGen/ScheduleHazardRecognizer.h"
Public Types | |
enum | HazardType { NoHazard , Hazard , NoopHazard } |
Public Member Functions | |
ScheduleHazardRecognizer ()=default | |
virtual | ~ScheduleHazardRecognizer () |
unsigned | getMaxLookAhead () const |
bool | isEnabled () const |
virtual bool | atIssueLimit () const |
atIssueLimit - Return true if no more instructions may be issued in this cycle. | |
virtual HazardType | getHazardType (SUnit *, int Stalls=0) |
getHazardType - Return the hazard type of emitting this node. | |
virtual void | Reset () |
Reset - This callback is invoked when a new block of instructions is about to be schedule. | |
virtual void | EmitInstruction (SUnit *) |
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard state. | |
virtual void | EmitInstruction (MachineInstr *) |
This overload will be used when the hazard recognizer is being used by a non-scheduling pass, which does not use SUnits. | |
virtual unsigned | PreEmitNoops (SUnit *) |
PreEmitNoops - This callback is invoked prior to emitting an instruction. | |
virtual unsigned | PreEmitNoops (MachineInstr *) |
This overload will be used when the hazard recognizer is being used by a non-scheduling pass, which does not use SUnits. | |
virtual bool | ShouldPreferAnother (SUnit *) |
ShouldPreferAnother - This callback may be invoked if getHazardType returns NoHazard. | |
virtual void | AdvanceCycle () |
AdvanceCycle - This callback is invoked whenever the next top-down instruction to be scheduled cannot issue in the current cycle, either because of latency or resource conflicts. | |
virtual void | RecedeCycle () |
RecedeCycle - This callback is invoked whenever the next bottom-up instruction to be scheduled cannot issue in the current cycle, either because of latency or resource conflicts. | |
virtual void | EmitNoop () |
EmitNoop - This callback is invoked when a noop was added to the instruction stream. | |
virtual void | EmitNoops (unsigned Quantity) |
EmitNoops - This callback is invoked when noops were added to the instruction stream. | |
Protected Attributes | |
unsigned | MaxLookAhead = 0 |
MaxLookAhead - Indicate the number of cycles in the scoreboard state. | |
HazardRecognizer - This determines whether or not an instruction can be issued this cycle, and whether or not a noop needs to be inserted to handle the hazard.
Definition at line 25 of file ScheduleHazardRecognizer.h.
Enumerator | |
---|---|
NoHazard | |
Hazard | |
NoopHazard |
Definition at line 37 of file ScheduleHazardRecognizer.h.
|
default |
|
virtualdefault |
|
inlinevirtual |
AdvanceCycle - This callback is invoked whenever the next top-down instruction to be scheduled cannot issue in the current cycle, either because of latency or resource conflicts.
This should increment the internal state of the hazard recognizer so that previously "Hazard" instructions will now not be hazards.
Reimplemented in llvm::MultiHazardRecognizer, llvm::ScoreboardHazardRecognizer, llvm::GCNHazardRecognizer, llvm::ARMHazardRecognizerFPMLx, llvm::ARMBankConflictHazardRecognizer, llvm::HexagonHazardRecognizer, llvm::PPCDispatchGroupSBHazardRecognizer, and llvm::PPCHazardRecognizer970.
Definition at line 104 of file ScheduleHazardRecognizer.h.
Referenced by llvm::SchedBoundary::bumpCycle(), and EmitNoop().
|
inlinevirtual |
atIssueLimit - Return true if no more instructions may be issued in this cycle.
FIXME: remove this once MachineScheduler is the only client.
Reimplemented in llvm::MultiHazardRecognizer, llvm::ScoreboardHazardRecognizer, and llvm::GCNHazardRecognizer.
Definition at line 51 of file ScheduleHazardRecognizer.h.
Referenced by llvm::MultiHazardRecognizer::atIssueLimit().
|
inlinevirtual |
This overload will be used when the hazard recognizer is being used by a non-scheduling pass, which does not use SUnits.
Reimplemented in llvm::MultiHazardRecognizer, and llvm::GCNHazardRecognizer.
Definition at line 75 of file ScheduleHazardRecognizer.h.
|
inlinevirtual |
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard state.
Reimplemented in llvm::MultiHazardRecognizer, llvm::HexagonHazardRecognizer, llvm::ScoreboardHazardRecognizer, llvm::GCNHazardRecognizer, llvm::ARMHazardRecognizerFPMLx, llvm::ARMBankConflictHazardRecognizer, llvm::PPCDispatchGroupSBHazardRecognizer, llvm::PPCHazardRecognizer970, and llvm::SystemZHazardRecognizer.
Definition at line 71 of file ScheduleHazardRecognizer.h.
Referenced by llvm::SchedBoundary::bumpNode().
|
inlinevirtual |
EmitNoop - This callback is invoked when a noop was added to the instruction stream.
Reimplemented in llvm::MultiHazardRecognizer, llvm::GCNHazardRecognizer, and llvm::PPCDispatchGroupSBHazardRecognizer.
Definition at line 113 of file ScheduleHazardRecognizer.h.
References AdvanceCycle().
Referenced by EmitNoops().
|
inlinevirtual |
EmitNoops - This callback is invoked when noops were added to the instruction stream.
Definition at line 120 of file ScheduleHazardRecognizer.h.
References EmitNoop().
|
inlinevirtual |
getHazardType - Return the hazard type of emitting this node.
There are three possible results. Either:
Reimplemented in llvm::MultiHazardRecognizer, llvm::ScoreboardHazardRecognizer, llvm::GCNHazardRecognizer, llvm::ARMHazardRecognizerFPMLx, llvm::ARMBankConflictHazardRecognizer, llvm::HexagonHazardRecognizer, llvm::PPCDispatchGroupSBHazardRecognizer, llvm::PPCHazardRecognizer970, and llvm::SystemZHazardRecognizer.
Definition at line 60 of file ScheduleHazardRecognizer.h.
References NoHazard.
Referenced by llvm::SchedBoundary::checkHazard().
|
inline |
Definition at line 43 of file ScheduleHazardRecognizer.h.
References MaxLookAhead.
Referenced by llvm::GCNHazardRecognizer::AdvanceCycle().
|
inline |
Definition at line 45 of file ScheduleHazardRecognizer.h.
References MaxLookAhead.
Referenced by llvm::SchedBoundary::bumpCycle(), llvm::SchedBoundary::bumpNode(), llvm::SchedBoundary::checkHazard(), llvm::SchedBoundary::reset(), and llvm::ScoreboardHazardRecognizer::ScoreboardHazardRecognizer().
|
inlinevirtual |
This overload will be used when the hazard recognizer is being used by a non-scheduling pass, which does not use SUnits.
Reimplemented in llvm::MultiHazardRecognizer, and llvm::GCNHazardRecognizer.
Definition at line 88 of file ScheduleHazardRecognizer.h.
PreEmitNoops - This callback is invoked prior to emitting an instruction.
It should return the number of noops to emit prior to the provided instruction. Note: This is only used during PostRA scheduling. EmitNoop is not called for these noops.
Reimplemented in llvm::MultiHazardRecognizer, and llvm::PPCDispatchGroupSBHazardRecognizer.
Definition at line 82 of file ScheduleHazardRecognizer.h.
Referenced by llvm::PPCDispatchGroupSBHazardRecognizer::PreEmitNoops().
|
inlinevirtual |
RecedeCycle - This callback is invoked whenever the next bottom-up instruction to be scheduled cannot issue in the current cycle, either because of latency or resource conflicts.
Reimplemented in llvm::MultiHazardRecognizer, llvm::ScoreboardHazardRecognizer, llvm::GCNHazardRecognizer, llvm::ARMHazardRecognizerFPMLx, llvm::ARMBankConflictHazardRecognizer, and llvm::PPCDispatchGroupSBHazardRecognizer.
Definition at line 109 of file ScheduleHazardRecognizer.h.
Referenced by llvm::SchedBoundary::bumpCycle().
|
inlinevirtual |
Reset - This callback is invoked when a new block of instructions is about to be schedule.
The hazard state should be set to an initialized state.
Reimplemented in llvm::MultiHazardRecognizer, llvm::ScoreboardHazardRecognizer, llvm::GCNHazardRecognizer, llvm::ARMHazardRecognizerFPMLx, llvm::ARMBankConflictHazardRecognizer, llvm::HexagonHazardRecognizer, llvm::PPCDispatchGroupSBHazardRecognizer, llvm::PPCHazardRecognizer970, and llvm::SystemZHazardRecognizer.
Definition at line 67 of file ScheduleHazardRecognizer.h.
Referenced by llvm::SchedBoundary::bumpNode().
ShouldPreferAnother - This callback may be invoked if getHazardType returns NoHazard.
If, even though there is no hazard, it would be better to schedule another available instruction, this callback should return true.
Reimplemented in llvm::MultiHazardRecognizer, llvm::HexagonHazardRecognizer, llvm::GCNHazardRecognizer, and llvm::PPCDispatchGroupSBHazardRecognizer.
Definition at line 95 of file ScheduleHazardRecognizer.h.
Referenced by llvm::PPCDispatchGroupSBHazardRecognizer::ShouldPreferAnother().
|
protected |
MaxLookAhead - Indicate the number of cycles in the scoreboard state.
Important to restore the state after backtracking. Additionally, MaxLookAhead=0 identifies a fake recognizer, allowing the client to bypass virtual calls. Currently the PostRA scheduler ignores it.
Definition at line 31 of file ScheduleHazardRecognizer.h.
Referenced by llvm::MultiHazardRecognizer::AddHazardRecognizer(), llvm::ARMBankConflictHazardRecognizer::ARMBankConflictHazardRecognizer(), llvm::ARMHazardRecognizerFPMLx::ARMHazardRecognizerFPMLx(), llvm::GCNHazardRecognizer::GCNHazardRecognizer(), getMaxLookAhead(), isEnabled(), and llvm::ScoreboardHazardRecognizer::ScoreboardHazardRecognizer().