LLVM
8.0.1
|
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. More... | |
virtual HazardType | getHazardType (SUnit *m, int Stalls=0) |
getHazardType - Return the hazard type of emitting this node. More... | |
virtual void | Reset () |
Reset - This callback is invoked when a new block of instructions is about to be schedule. More... | |
virtual void | EmitInstruction (SUnit *) |
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard state. More... | |
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. More... | |
virtual unsigned | PreEmitNoops (SUnit *) |
PreEmitNoops - This callback is invoked prior to emitting an instruction. More... | |
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. More... | |
virtual bool | ShouldPreferAnother (SUnit *) |
ShouldPreferAnother - This callback may be invoked if getHazardType returns NoHazard. More... | |
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. More... | |
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. More... | |
virtual void | EmitNoop () |
EmitNoop - This callback is invoked when a noop was added to the instruction stream. More... | |
Protected Attributes | |
unsigned | MaxLookAhead = 0 |
MaxLookAhead - Indicate the number of cycles in the scoreboard state. More... | |
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 26 of file ScheduleHazardRecognizer.h.
Enumerator | |
---|---|
NoHazard | |
Hazard | |
NoopHazard |
Definition at line 38 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::ScoreboardHazardRecognizer, llvm::GCNHazardRecognizer, llvm::PPCHazardRecognizer970, llvm::HexagonHazardRecognizer, llvm::PPCDispatchGroupSBHazardRecognizer, and llvm::ARMHazardRecognizer.
Definition at line 105 of file ScheduleHazardRecognizer.h.
Referenced by 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::ScoreboardHazardRecognizer, and llvm::GCNHazardRecognizer.
Definition at line 52 of file ScheduleHazardRecognizer.h.
|
inlinevirtual |
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard state.
Reimplemented in llvm::ScoreboardHazardRecognizer, llvm::SystemZHazardRecognizer, llvm::GCNHazardRecognizer, llvm::PPCHazardRecognizer970, llvm::HexagonHazardRecognizer, llvm::PPCDispatchGroupSBHazardRecognizer, and llvm::ARMHazardRecognizer.
Definition at line 72 of file ScheduleHazardRecognizer.h.
|
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::GCNHazardRecognizer.
Definition at line 76 of file ScheduleHazardRecognizer.h.
|
inlinevirtual |
EmitNoop - This callback is invoked when a noop was added to the instruction stream.
Reimplemented in llvm::GCNHazardRecognizer, and llvm::PPCDispatchGroupSBHazardRecognizer.
Definition at line 114 of file ScheduleHazardRecognizer.h.
References AdvanceCycle().
|
inlinevirtual |
getHazardType - Return the hazard type of emitting this node.
There are three possible results. Either:
Reimplemented in llvm::ScoreboardHazardRecognizer, llvm::SystemZHazardRecognizer, llvm::GCNHazardRecognizer, llvm::PPCHazardRecognizer970, llvm::HexagonHazardRecognizer, llvm::ARMHazardRecognizer, and llvm::PPCDispatchGroupSBHazardRecognizer.
Definition at line 61 of file ScheduleHazardRecognizer.h.
References NoHazard.
|
inline |
Definition at line 44 of file ScheduleHazardRecognizer.h.
References MaxLookAhead.
Referenced by llvm::GCNHazardRecognizer::AdvanceCycle().
|
inline |
Definition at line 46 of file ScheduleHazardRecognizer.h.
Referenced by llvm::ScoreboardHazardRecognizer::ScoreboardHazardRecognizer().
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::GCNHazardRecognizer, and llvm::PPCDispatchGroupSBHazardRecognizer.
Definition at line 83 of file ScheduleHazardRecognizer.h.
Referenced by llvm::PPCDispatchGroupSBHazardRecognizer::PreEmitNoops().
|
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::GCNHazardRecognizer.
Definition at line 89 of file ScheduleHazardRecognizer.h.
|
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::ScoreboardHazardRecognizer, llvm::GCNHazardRecognizer, llvm::PPCDispatchGroupSBHazardRecognizer, and llvm::ARMHazardRecognizer.
Definition at line 110 of file ScheduleHazardRecognizer.h.
|
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::ScoreboardHazardRecognizer, llvm::SystemZHazardRecognizer, llvm::PPCHazardRecognizer970, llvm::HexagonHazardRecognizer, llvm::PPCDispatchGroupSBHazardRecognizer, and llvm::ARMHazardRecognizer.
Definition at line 68 of file ScheduleHazardRecognizer.h.
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::HexagonHazardRecognizer, and llvm::PPCDispatchGroupSBHazardRecognizer.
Definition at line 96 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 32 of file ScheduleHazardRecognizer.h.
Referenced by llvm::GCNHazardRecognizer::GCNHazardRecognizer(), getMaxLookAhead(), and llvm::ScoreboardHazardRecognizer::ScoreboardHazardRecognizer().