LLVM 20.0.0git
Public Types | Public Member Functions | List of all members
llvm::SDep Class Reference

Scheduling dependency. More...

#include "llvm/CodeGen/ScheduleDAG.h"

Public Types

enum  Kind { Data , Anti , Output , Order }
 These are the different kinds of scheduling dependencies. More...
 
enum  OrderKind {
  Barrier , MayAliasMem , MustAliasMem , Artificial ,
  Weak , Cluster
}
 

Public Member Functions

 SDep ()
 Constructs a null SDep.
 
 SDep (SUnit *S, Kind kind, unsigned Reg)
 Constructs an SDep with the specified values.
 
 SDep (SUnit *S, OrderKind kind)
 
bool overlaps (const SDep &Other) const
 Returns true if the specified SDep is equivalent except for latency.
 
bool operator== (const SDep &Other) const
 
bool operator!= (const SDep &Other) const
 
unsigned getLatency () const
 Returns the latency value for this edge, which roughly means the minimum number of cycles that must elapse between the predecessor and the successor, given that they have this edge between them.
 
void setLatency (unsigned Lat)
 Sets the latency for this edge.
 
SUnitgetSUnit () const
 
void setSUnit (SUnit *SU)
 
Kind getKind () const
 Returns an enum value representing the kind of the dependence.
 
bool isCtrl () const
 Shorthand for getKind() != SDep::Data.
 
bool isNormalMemory () const
 Tests if this is an Order dependence between two memory accesses where both sides of the dependence access memory in non-volatile and fully modeled ways.
 
bool isBarrier () const
 Tests if this is an Order dependence that is marked as a barrier.
 
bool isNormalMemoryOrBarrier () const
 Tests if this is could be any kind of memory dependence.
 
bool isMustAlias () const
 Tests if this is an Order dependence that is marked as "must alias", meaning that the SUnits at either end of the edge have a memory dependence on a known memory location.
 
bool isWeak () const
 Tests if this a weak dependence.
 
bool isArtificial () const
 Tests if this is an Order dependence that is marked as "artificial", meaning it isn't necessary for correctness.
 
bool isCluster () const
 Tests if this is an Order dependence that is marked as "cluster", meaning it is artificial and wants to be adjacent.
 
bool isAssignedRegDep () const
 Tests if this is a Data dependence that is associated with a register.
 
unsigned getReg () const
 Returns the register associated with this edge.
 
void setReg (unsigned Reg)
 Assigns the associated register for this edge.
 
void dump (const TargetRegisterInfo *TRI=nullptr) const
 

Detailed Description

Scheduling dependency.

This represents one direction of an edge in the scheduling DAG.

Definition at line 49 of file ScheduleDAG.h.

Member Enumeration Documentation

◆ Kind

These are the different kinds of scheduling dependencies.

Enumerator
Data 

Regular data dependence (aka true-dependence).

Anti 

A register anti-dependence (aka WAR).

Output 

A register output-dependence (aka WAW).

Order 

Any other ordering dependency.

Definition at line 52 of file ScheduleDAG.h.

◆ OrderKind

Enumerator
Barrier 

An unknown scheduling barrier.

MayAliasMem 

Nonvolatile load/Store instructions that may alias.

MustAliasMem 

Nonvolatile load/Store instructions that must alias.

Artificial 

Arbitrary strong DAG edge (no real dependence).

Weak 

Arbitrary weak DAG edge.

Cluster 

Weak DAG edge linking a chain of clustered instrs.

Definition at line 68 of file ScheduleDAG.h.

Constructor & Destructor Documentation

◆ SDep() [1/3]

llvm::SDep::SDep ( )
inline

Constructs a null SDep.

This is only for use by container classes which require default constructors. SUnits may not/ have null SDep edges.

Definition at line 101 of file ScheduleDAG.h.

◆ SDep() [2/3]

llvm::SDep::SDep ( SUnit S,
Kind  kind,
unsigned  Reg 
)
inline

Constructs an SDep with the specified values.

Definition at line 104 of file ScheduleDAG.h.

References Anti, assert(), Data, llvm::Latency, llvm_unreachable, Output, and Reg.

◆ SDep() [3/3]

llvm::SDep::SDep ( SUnit S,
OrderKind  kind 
)
inline

Definition at line 123 of file ScheduleDAG.h.

References llvm::Latency.

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void SDep::dump ( const TargetRegisterInfo TRI = nullptr) const

◆ getKind()

SDep::Kind llvm::SDep::getKind ( ) const
inline

◆ getLatency()

unsigned llvm::SDep::getLatency ( ) const
inline

Returns the latency value for this edge, which roughly means the minimum number of cycles that must elapse between the predecessor and the successor, given that they have this edge between them.

Definition at line 142 of file ScheduleDAG.h.

References llvm::Latency.

Referenced by llvm::GCNSubtarget::adjustSchedDependency(), llvm::HexagonSubtarget::adjustSchedDependency(), llvm::SMSchedule::computeStart(), CriticalPathStep(), dump(), llvm::NodeSet::NodeSet(), llvm::ScheduleDAGMI::releasePred(), llvm::ScheduleDAGMI::releaseSucc(), llvm::ConvergingVLIWScheduler::releaseTopNode(), and llvm::ConvergingVLIWScheduler::SchedulingCost().

◆ getReg()

unsigned llvm::SDep::getReg ( ) const
inline

Returns the register associated with this edge.

This is only valid on Data, Anti, and Output edges. On Data edges, this value may be zero, meaning there is no associated register.

Definition at line 218 of file ScheduleDAG.h.

References Anti, assert(), Data, getKind(), and Output.

Referenced by llvm::AArch64Subtarget::adjustSchedDependency(), llvm::GCNSubtarget::adjustSchedDependency(), AntiDepEdges(), llvm::AggressiveAntiDepBreaker::BreakAntiDependencies(), canClobberReachingPhysRegUse(), and dump().

◆ getSUnit()

SUnit * llvm::SDep::getSUnit ( ) const
inline

Definition at line 498 of file ScheduleDAG.h.

Referenced by llvm::ScheduleDAGInstrs::addEdge(), llvm::AggressiveAntiDepBreaker::BreakAntiDependencies(), CalcNodeSethiUllmanNumber(), canClobberReachingPhysRegUse(), closestSucc(), llvm::SchedDFSResult::compute(), llvm::SMSchedule::computeStart(), CriticalPathStep(), llvm::ScheduleDAG::dumpNodeAll(), llvm::SMSchedule::earliestCycleInChain(), hasDataSucc(), hasOnlyLiveInOpers(), hasOnlyLiveOutUses(), hasVRegCycleUse(), llvm::ScheduleDAGTopologicalSort::InitDAGTopologicalSorting(), initVRegCycle(), llvm::SwingSchedulerDAG::isBackedge(), llvm::SwingSchedulerDAG::isLoopCarriedDep(), llvm::ResourcePriorityQueue::isResourceAvailable(), llvm::SchedDFSImpl::joinPredSubtree(), llvm::SMSchedule::latestCycleInChain(), multipleIterations(), llvm::NodeSet::NodeSet(), llvm::SMSchedule::onlyHasLoopCarriedOutputOrOrderPreds(), llvm::SMSchedule::orderDependence(), pred_L(), llvm::LatencyPriorityQueue::push(), llvm::ResourcePriorityQueue::push(), llvm::ScheduleDAGMI::releasePred(), llvm::ScheduleDAGMI::releaseSucc(), llvm::ConvergingVLIWScheduler::releaseTopNode(), resetVRegCycle(), llvm::LatencyPriorityQueue::scheduledNode(), llvm::ResourcePriorityQueue::scheduledNode(), llvm::ConvergingVLIWScheduler::SchedulingCost(), llvm::SUnit::setDepthDirty(), llvm::SUnit::setHeightDirty(), succ_L(), llvm::SchedDFSImpl::visitCrossEdge(), llvm::SchedDFSImpl::visitPostorderEdge(), llvm::SchedDFSImpl::visitPostorderNode(), and llvm::ScheduleDAGTopologicalSort::WillCreateCycle().

◆ isArtificial()

bool llvm::SDep::isArtificial ( ) const
inline

Tests if this is an Order dependence that is marked as "artificial", meaning it isn't necessary for correctness.

Definition at line 200 of file ScheduleDAG.h.

References Artificial, getKind(), and Order.

Referenced by llvm::ScheduleDAGInstrs::addEdge(), llvm::HexagonSubtarget::adjustSchedDependency(), llvm::SUnitIterator::isArtificialDep(), and llvm::SwingSchedulerDAG::isLoopCarriedDep().

◆ isAssignedRegDep()

bool llvm::SDep::isAssignedRegDep ( ) const
inline

Tests if this is a Data dependence that is associated with a register.

Definition at line 211 of file ScheduleDAG.h.

References Data, and getKind().

Referenced by canClobberReachingPhysRegUse(), dump(), llvm::ConvergingVLIWScheduler::SchedulingCost(), and llvm::ScheduleDAGTopologicalSort::WillCreateCycle().

◆ isBarrier()

bool llvm::SDep::isBarrier ( ) const
inline

Tests if this is an Order dependence that is marked as a barrier.

Definition at line 174 of file ScheduleDAG.h.

References Barrier, getKind(), and Order.

Referenced by isNormalMemoryOrBarrier().

◆ isCluster()

bool llvm::SDep::isCluster ( ) const
inline

Tests if this is an Order dependence that is marked as "cluster", meaning it is artificial and wants to be adjacent.

Definition at line 206 of file ScheduleDAG.h.

References Cluster, getKind(), and Order.

Referenced by llvm::ScheduleDAGMI::releasePred(), and llvm::ScheduleDAGMI::releaseSucc().

◆ isCtrl()

bool llvm::SDep::isCtrl ( ) const
inline

◆ isMustAlias()

bool llvm::SDep::isMustAlias ( ) const
inline

Tests if this is an Order dependence that is marked as "must alias", meaning that the SUnits at either end of the edge have a memory dependence on a known memory location.

Definition at line 186 of file ScheduleDAG.h.

References getKind(), MustAliasMem, and Order.

◆ isNormalMemory()

bool llvm::SDep::isNormalMemory ( ) const
inline

Tests if this is an Order dependence between two memory accesses where both sides of the dependence access memory in non-volatile and fully modeled ways.

Definition at line 168 of file ScheduleDAG.h.

References getKind(), MayAliasMem, MustAliasMem, and Order.

Referenced by isNormalMemoryOrBarrier().

◆ isNormalMemoryOrBarrier()

bool llvm::SDep::isNormalMemoryOrBarrier ( ) const
inline

Tests if this is could be any kind of memory dependence.

Definition at line 179 of file ScheduleDAG.h.

References isBarrier(), and isNormalMemory().

◆ isWeak()

bool llvm::SDep::isWeak ( ) const
inline

Tests if this a weak dependence.

Weak dependencies are considered DAG edges for height computation and other heuristics, but do not force ordering. Breaking a weak edge may require the scheduler to compensate, for example by inserting a copy.

Definition at line 194 of file ScheduleDAG.h.

References getKind(), Order, and Weak.

Referenced by llvm::ScheduleDAGMI::releasePred(), and llvm::ScheduleDAGMI::releaseSucc().

◆ operator!=()

bool llvm::SDep::operator!= ( const SDep Other) const
inline

Definition at line 135 of file ScheduleDAG.h.

References operator==(), and llvm::Other.

◆ operator==()

bool llvm::SDep::operator== ( const SDep Other) const
inline

Definition at line 131 of file ScheduleDAG.h.

References llvm::Latency, llvm::Other, and overlaps().

Referenced by operator!=().

◆ overlaps()

bool llvm::SDep::overlaps ( const SDep Other) const
inline

Returns true if the specified SDep is equivalent except for latency.

Definition at line 483 of file ScheduleDAG.h.

References Anti, Data, llvm_unreachable, Order, llvm::Other, and Output.

Referenced by operator==().

◆ setLatency()

void llvm::SDep::setLatency ( unsigned  Lat)
inline

◆ setReg()

void llvm::SDep::setReg ( unsigned  Reg)
inline

Assigns the associated register for this edge.

This is only valid on Data, Anti, and Output edges. On Anti and Output edges, this value must not be zero. On Data edges, the value may be zero, which would mean that no specific register is associated with this edge.

Definition at line 228 of file ScheduleDAG.h.

References Anti, assert(), Data, getKind(), Output, and Reg.

◆ setSUnit()

void llvm::SDep::setSUnit ( SUnit SU)
inline

Definition at line 501 of file ScheduleDAG.h.

Referenced by llvm::SUnit::addPred().

Member Data Documentation

◆ OrdKind

unsigned llvm::SDep::OrdKind

Additional information about Order dependencies.

Definition at line 90 of file ScheduleDAG.h.

◆ Reg

unsigned llvm::SDep::Reg

For Data, Anti, and Output dependencies, the associated register.

For Data dependencies that don't currently have a register/ assigned, this is set to zero.

Definition at line 87 of file ScheduleDAG.h.

Referenced by SDep(), and setReg().


The documentation for this class was generated from the following files: