31 const GCNSubtarget &ST;
32 const SIRegisterInfo &TRI;
33 const MachineRegisterInfo &MRI;
36 HazardLatency(MachineFunction *MF)
37 : ST(MF->getSubtarget<GCNSubtarget>()), TRI(*ST.getRegisterInfo()),
38 MRI(MF->getRegInfo()) {}
39 void apply(ScheduleDAGInstrs *DAG)
override;
43 constexpr unsigned MaskLatencyBoost = 3;
49 for (SUnit &SU : DAG->
SUnits) {
53 if (
MI->getOpcode() == AMDGPU::V_READLANE_B32 ||
54 MI->getOpcode() == AMDGPU::V_READFIRSTLANE_B32)
56 for (SDep &SuccDep : SU.
Succs) {
74std::unique_ptr<ScheduleDAGMutation>
76 return std::make_unique<HazardLatency>(MF);
unsigned const MachineRegisterInfo * MRI
Provides AMDGPU specific target descriptions.
AMD GCN specific subclass of TargetSubtarget.
Register const TargetRegisterInfo * TRI
Promote Memory to Register
Interface definition for SIInstrInfo.
bool hasVALUMaskWriteHazard() const
void setLatency(unsigned Lat)
Sets the latency for this edge.
unsigned getLatency() const
Returns the latency value for this edge, which roughly means the minimum number of cycles that must e...
bool isCtrl() const
Shorthand for getKind() != SDep::Data.
Register getReg() const
Returns the register associated with this edge.
static bool isVALU(const MachineInstr &MI)
SmallVector< SDep, 4 > Succs
All sunit successors.
MachineInstr * getInstr() const
Returns the representative MachineInstr for this SUnit.
A ScheduleDAG for scheduling lists of MachineInstr.
Mutate the DAG as a postpass after normal DAG building.
std::vector< SUnit > SUnits
The scheduling units.
void apply(Opt *O, const Mod &M, const Mods &... Ms)
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< ScheduleDAGMutation > createAMDGPUHazardLatencyDAGMutation(MachineFunction *MF)