31 BarrierLatency() =
default;
32 void apply(ScheduleDAGInstrs *DAG)
override;
36 constexpr unsigned SyntheticLatency = 2000;
37 for (SUnit &SU : DAG->
SUnits) {
39 if (
MI->getOpcode() != AMDGPU::ATOMIC_FENCE)
45 for (SDep &PredDep : SU.
Preds) {
51 if (!
MI->mayLoad() ||
MI->mayStore())
53 SDep ForwardD = PredDep;
55 for (SDep &SuccDep : PredSU->
Succs) {
56 if (SuccDep == ForwardD) {
70std::unique_ptr<ScheduleDAGMutation>
72 return std::make_unique<BarrierLatency>();
Provides AMDGPU specific target descriptions.
Interface definition for SIInstrInfo.
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 isBarrier() const
Tests if this is an Order dependence that is marked as a barrier.
SmallVector< SDep, 4 > Succs
All sunit successors.
LLVM_ABI void setDepthDirty()
Sets a flag in this node to indicate that its stored Depth value will require recomputation the next ...
SmallVector< SDep, 4 > Preds
All sunit predecessors.
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 > createAMDGPUBarrierLatencyDAGMutation()