LLVM
15.0.0git
|
#include "Target/AMDGPU/GCNHazardRecognizer.h"
Public Types | |
typedef function_ref< bool(const MachineInstr &)> | IsHazardFn |
![]() | |
enum | HazardType { NoHazard, Hazard, NoopHazard } |
Public Member Functions | |
GCNHazardRecognizer (const MachineFunction &MF) | |
bool | atIssueLimit () const override |
atIssueLimit - Return true if no more instructions may be issued in this cycle. More... | |
void | EmitInstruction (SUnit *SU) override |
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard state. More... | |
void | EmitInstruction (MachineInstr *MI) override |
This overload will be used when the hazard recognizer is being used by a non-scheduling pass, which does not use SUnits. More... | |
HazardType | getHazardType (SUnit *SU, int Stalls) override |
getHazardType - Return the hazard type of emitting this node. More... | |
void | EmitNoop () override |
EmitNoop - This callback is invoked when a noop was added to the instruction stream. More... | |
unsigned | PreEmitNoops (MachineInstr *) override |
This overload will be used when the hazard recognizer is being used by a non-scheduling pass, which does not use SUnits. More... | |
unsigned | PreEmitNoopsCommon (MachineInstr *) |
void | AdvanceCycle () override |
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... | |
void | RecedeCycle () override |
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... | |
bool | ShouldPreferAnother (SUnit *SU) override |
ShouldPreferAnother - This callback may be invoked if getHazardType returns NoHazard. More... | |
void | Reset () override |
Reset - This callback is invoked when a new block of instructions is about to be schedule. More... | |
![]() | |
ScheduleHazardRecognizer ()=default | |
virtual | ~ScheduleHazardRecognizer () |
unsigned | getMaxLookAhead () const |
bool | isEnabled () const |
virtual unsigned | PreEmitNoops (SUnit *) |
PreEmitNoops - This callback is invoked prior to emitting an instruction. More... | |
virtual void | EmitNoops (unsigned Quantity) |
EmitNoops - This callback is invoked when noops were added to the instruction stream. More... | |
Additional Inherited Members | |
![]() | |
unsigned | MaxLookAhead = 0 |
MaxLookAhead - Indicate the number of cycles in the scoreboard state. More... | |
Definition at line 32 of file GCNHazardRecognizer.h.
typedef function_ref<bool(const MachineInstr &)> llvm::GCNHazardRecognizer::IsHazardFn |
Definition at line 34 of file GCNHazardRecognizer.h.
GCNHazardRecognizer::GCNHazardRecognizer | ( | const MachineFunction & | MF | ) |
Definition at line 53 of file GCNHazardRecognizer.cpp.
References llvm::MachineFunction::getRegInfo(), llvm::TargetSchedModel::init(), llvm::MachineRegisterInfo::isPhysRegUsed(), llvm::ScheduleHazardRecognizer::MaxLookAhead, and shouldRunLdsBranchVmemWARHazardFixup().
|
overridevirtual |
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 from llvm::ScheduleHazardRecognizer.
Definition at line 381 of file GCNHazardRecognizer.cpp.
References llvm::numbers::e, llvm::ScheduleHazardRecognizer::getMaxLookAhead(), llvm::SIInstrInfo::getNumWaitStates(), i, llvm::MachineInstr::isBundle(), and llvm::min().
|
inlineoverridevirtual |
atIssueLimit - Return true if no more instructions may be issued in this cycle.
FIXME: remove this once MachineScheduler is the only client.
Reimplemented from llvm::ScheduleHazardRecognizer.
Definition at line 129 of file GCNHazardRecognizer.h.
|
overridevirtual |
This overload will be used when the hazard recognizer is being used by a non-scheduling pass, which does not use SUnits.
Reimplemented from llvm::ScheduleHazardRecognizer.
Definition at line 75 of file GCNHazardRecognizer.cpp.
References MI.
|
overridevirtual |
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard state.
Reimplemented from llvm::ScheduleHazardRecognizer.
Definition at line 71 of file GCNHazardRecognizer.cpp.
References llvm::SUnit::getInstr().
|
overridevirtual |
EmitNoop - This callback is invoked when a noop was added to the instruction stream.
Reimplemented from llvm::ScheduleHazardRecognizer.
Definition at line 377 of file GCNHazardRecognizer.cpp.
|
overridevirtual |
getHazardType - Return the hazard type of emitting this node.
There are three possible results. Either:
Reimplemented from llvm::ScheduleHazardRecognizer.
Definition at line 181 of file GCNHazardRecognizer.cpp.
References llvm::SUnit::getInstr(), llvm::GCNSubtarget::hasNoDataDepHazard(), llvm::GCNSubtarget::hasNSAtoVMEMBug(), llvm::GCNSubtarget::hasReadM0LdsDirectHazard(), llvm::GCNSubtarget::hasReadM0LdsDmaHazard(), llvm::GCNSubtarget::hasReadM0MovRelInterpHazard(), llvm::GCNSubtarget::hasReadM0SendMsgHazard(), llvm::ScheduleHazardRecognizer::Hazard, isDivFMas(), llvm::SIInstrInfo::isDPP(), llvm::SIInstrInfo::isDS(), llvm::SIInstrInfo::isEXP(), llvm::SIInstrInfo::isFLAT(), isLdsDma(), llvm::SIInstrInfo::isMAI(), isRFE(), isRWLane(), isSendMsgTraceDataOrGDS(), isSGetReg(), isSMovRel(), llvm::SIInstrInfo::isSMRD(), isSSetReg(), llvm::SIInstrInfo::isVALU(), llvm::SIInstrInfo::isVINTRP(), llvm::SIInstrInfo::isVMEM(), MI, llvm::ScheduleHazardRecognizer::NoHazard, and llvm::ScheduleHazardRecognizer::NoopHazard.
|
overridevirtual |
This overload will be used when the hazard recognizer is being used by a non-scheduling pass, which does not use SUnits.
Reimplemented from llvm::ScheduleHazardRecognizer.
Definition at line 301 of file GCNHazardRecognizer.cpp.
References MI, PreEmitNoopsCommon(), and llvm::RISCVFenceField::W.
unsigned GCNHazardRecognizer::PreEmitNoopsCommon | ( | MachineInstr * | MI | ) |
Definition at line 310 of file GCNHazardRecognizer.cpp.
References llvm::GCNSubtarget::hasNoDataDepHazard(), llvm::GCNSubtarget::hasNSAtoVMEMBug(), llvm::GCNSubtarget::hasReadM0LdsDirectHazard(), llvm::GCNSubtarget::hasReadM0LdsDmaHazard(), llvm::GCNSubtarget::hasReadM0MovRelInterpHazard(), llvm::GCNSubtarget::hasReadM0SendMsgHazard(), isDivFMas(), llvm::SIInstrInfo::isDPP(), llvm::SIInstrInfo::isDS(), llvm::SIInstrInfo::isEXP(), llvm::SIInstrInfo::isFLAT(), isLdsDma(), llvm::SIInstrInfo::isMAI(), isRFE(), isRWLane(), isSendMsgTraceDataOrGDS(), isSGetReg(), isSMovRel(), llvm::SIInstrInfo::isSMRD(), isSSetReg(), llvm::SIInstrInfo::isVALU(), llvm::SIInstrInfo::isVINTRP(), llvm::SIInstrInfo::isVMEM(), llvm::max(), and MI.
Referenced by PreEmitNoops().
|
overridevirtual |
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 from llvm::ScheduleHazardRecognizer.
Definition at line 419 of file GCNHazardRecognizer.cpp.
References llvm_unreachable.
|
overridevirtual |
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 from llvm::ScheduleHazardRecognizer.
Definition at line 67 of file GCNHazardRecognizer.cpp.
|
overridevirtual |
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 from llvm::ScheduleHazardRecognizer.
Definition at line 2471 of file GCNHazardRecognizer.cpp.
References llvm::SUnit::getInstr(), int, llvm::SUnit::isInstr(), llvm::SIInstrInfo::isMFMA(), MI, and llvm::RISCVFenceField::W.