13#ifndef LLVM_LIB_TARGET_AMDGPUHAZARDRECOGNIZERS_H
14#define LLVM_LIB_TARGET_AMDGPUHAZARDRECOGNIZERS_H
41 bool IsHazardRecognizerMode;
47 std::list<MachineInstr*> EmittedInstrs;
52 std::list<MachineInstr *> EmittedVALUInstrs;
57 static constexpr unsigned MaxVALULookAhead = 18;
61 bool HasPendingWMMACoexecHazard =
false;
72 bool RunLdsBranchVmemWARHazardFixup;
80 void resetClause()
const {
102 int getWaitStatesSinceVALU(
IsHazardFn IsHazard,
int Limit)
const;
103 int getWaitStatesSinceDef(
unsigned Reg,
IsHazardFn IsHazardDef,
105 int getWaitStatesSinceSetReg(
IsHazardFn IsHazard,
int Limit)
const;
112 int checkGetRegHazards(
MachineInstr *GetRegInstr)
const;
113 int checkSetRegHazards(
MachineInstr *SetRegInstr)
const;
118 int checkUniformWindowVALUHazardsHelper(
Register Reg)
const;
119 int checkSOFFSETWindowVALUHazardsHelper(
Register Reg)
const;
129 int WaitStatesNeeded,
bool IsHoisting =
false);
144 bool tryHoistWMMAVnopsFromLoop(
MachineInstr *
MI,
int WaitStatesNeeded);
146 bool IncludeSubloops =
true);
204 void Reset()
override;
This file implements the BitVector class.
static int getWaitStatesSince(GCNHazardRecognizer::IsHazardFn IsHazard, const MachineBasicBlock *MBB, MachineBasicBlock::const_reverse_instr_iterator I, int WaitStates, GCNHazardRecognizer::IsExpiredFn IsExpired, DenseSet< const MachineBasicBlock * > &Visited, GCNHazardRecognizer::GetNumWaitStatesFn GetNumWaitStates=SIInstrInfo::getNumWaitStates)
BitVector & reset()
Reset all bits in the bitvector.
unsigned getHazardWaitStates(MachineInstr *MI) const
Returns the number of wait states until all hazards for MI are resolved.
unsigned PreEmitNoopsCommon(MachineInstr *) const
void EmitNoop() override
EmitNoop - This callback is invoked when a noop was added to the instruction stream.
void Reset() override
Reset - This callback is invoked when a new block of instructions is about to be schedule.
unsigned PreEmitNoops(MachineInstr *) override
This overload will be used when the hazard recognizer is being used by a non-scheduling pass,...
void EmitInstruction(SUnit *SU) override
EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard stat...
function_ref< bool(const MachineInstr &)> IsHazardFn
void AdvanceCycle() override
AdvanceCycle - This callback is invoked whenever the next top-down instruction to be scheduled cannot...
function_ref< unsigned int(const MachineInstr &)> GetNumWaitStatesFn
bool ShouldPreferAnother(SUnit *SU) const override
ShouldPreferAnother - This callback may be invoked if getHazardType returns NoHazard.
function_ref< bool(const MachineInstr &, int WaitStates)> IsExpiredFn
GCNHazardRecognizer(const MachineFunction &MF, MachineLoopInfo *MLI=nullptr)
HazardType getHazardType(SUnit *SU, int Stalls) 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...
bool atIssueLimit() const override
atIssueLimit - Return true if no more instructions may be issued in this cycle.
MachineInstrBundleIterator< MachineInstr > iterator
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Wrapper class representing virtual and physical registers.
Scheduling unit. This is a node in the scheduling DAG.
ScheduleHazardRecognizer()=default
Provide an instruction scheduling machine model to CodeGen passes.
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.