LLVM
8.0.1
|
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. More... | |
SDep (SUnit *S, Kind kind, unsigned Reg) | |
Constructs an SDep with the specified values. More... | |
SDep (SUnit *S, OrderKind kind) | |
bool | overlaps (const SDep &Other) const |
Returns true if the specified SDep is equivalent except for latency. More... | |
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. More... | |
void | setLatency (unsigned Lat) |
Sets the latency for this edge. More... | |
SUnit * | getSUnit () const |
void | setSUnit (SUnit *SU) |
Kind | getKind () const |
Returns an enum value representing the kind of the dependence. More... | |
bool | isCtrl () const |
Shorthand for getKind() != SDep::Data. More... | |
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. More... | |
bool | isBarrier () const |
Tests if this is an Order dependence that is marked as a barrier. More... | |
bool | isNormalMemoryOrBarrier () const |
Tests if this is could be any kind of memory dependence. More... | |
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. More... | |
bool | isWeak () const |
Tests if this a weak dependence. More... | |
bool | isArtificial () const |
Tests if this is an Order dependence that is marked as "artificial", meaning it isn't necessary for correctness. More... | |
bool | isCluster () const |
Tests if this is an Order dependence that is marked as "cluster", meaning it is artificial and wants to be adjacent. More... | |
bool | isAssignedRegDep () const |
Tests if this is a Data dependence that is associated with a register. More... | |
unsigned | getReg () const |
Returns the register associated with this edge. More... | |
void | setReg (unsigned Reg) |
Assigns the associated register for this edge. More... | |
void | dump (const TargetRegisterInfo *TRI=nullptr) const |
Scheduling dependency.
This represents one direction of an edge in the scheduling DAG.
Definition at line 50 of file ScheduleDAG.h.
enum llvm::SDep::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 53 of file ScheduleDAG.h.
Definition at line 69 of file ScheduleDAG.h.
|
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 102 of file ScheduleDAG.h.
Constructs an SDep with the specified values.
Definition at line 105 of file ScheduleDAG.h.
References Anti, assert(), Data, llvm_unreachable, Output, and Reg.
Definition at line 124 of file ScheduleDAG.h.
References Other, and overlaps().
LLVM_DUMP_METHOD void SDep::dump | ( | const TargetRegisterInfo * | TRI = nullptr | ) | const |
Definition at line 71 of file ScheduleDAG.cpp.
References llvm::MCID::Barrier, llvm::Data, llvm::dbgs(), getLatency(), getReg(), and llvm::printReg().
Referenced by llvm::ScheduleDAG::dumpNodeAll(), llvm::ScheduleDAG::getInstrDesc(), and setReg().
|
inline |
Returns an enum value representing the kind of the dependence.
Definition at line 490 of file ScheduleDAG.h.
Referenced by llvm::SUnit::addPred(), llvm::HexagonSubtarget::HVXMemLatencyMutation::apply(), llvm::SchedDFSResult::compute(), llvm::ScheduleDAGSDNodes::computeOperandLatency(), llvm::createCopyConstrainDAGMutation(), llvm::SMSchedule::earliestCycleInChain(), llvm::SwingSchedulerDAG::getDistance(), getReg(), hasDataSucc(), ignoreDependence(), isArtificial(), isAssignedRegDep(), llvm::SwingSchedulerDAG::isBackedge(), isBarrier(), isCluster(), isCtrl(), isHazard(), llvm::SwingSchedulerDAG::isLoopCarriedDep(), isMustAlias(), isNormalMemory(), isWeak(), llvm::SchedDFSImpl::joinPredSubtree(), llvm::SMSchedule::latestCycleInChain(), llvm::SUnit::removePred(), setLatency(), setReg(), and llvm::SchedDFSImpl::visitPostorderNode().
|
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 143 of file ScheduleDAG.h.
Referenced by llvm::SUnit::addPred(), llvm::HexagonSubtarget::HVXMemLatencyMutation::apply(), llvm::SMSchedule::computeStart(), llvm::ScheduleDAGMI::releasePred(), llvm::ScheduleDAGMI::releaseSucc(), llvm::ConvergingVLIWScheduler::releaseTopNode(), llvm::ConvergingVLIWScheduler::SchedulingCost(), llvm::SUnit::setHeightToAtLeast(), swapAntiDependences(), and llvm::HexagonSubtarget::usePredicatedCalls().
|
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 219 of file ScheduleDAG.h.
References Anti, assert(), Data, getKind(), and Output.
Referenced by canClobberReachingPhysRegUse(), CheckForLiveRegDef(), llvm::createCopyConstrainDAGMutation(), FindCallSeqStart(), getNodeRegMask(), and swapAntiDependences().
|
inline |
Definition at line 484 of file ScheduleDAG.h.
Referenced by llvm::ScheduleDAGMI::addEdge(), llvm::SUnit::addPred(), llvm::HexagonSubtarget::HVXMemLatencyMutation::apply(), CalcNodeSethiUllmanNumber(), canClobberPhysRegDefs(), canClobberReachingPhysRegUse(), CheckForLiveRegDef(), closestSucc(), llvm::SchedDFSResult::compute(), llvm::SMSchedule::computeStart(), llvm::createCopyConstrainDAGMutation(), CriticalPathStep(), llvm::ScheduleDAG::dumpNodeAll(), llvm::SMSchedule::earliestCycleInChain(), FindCallSeqStart(), fuseInstructionPair(), llvm::GCNSubtarget::getMaxNumVGPRs(), getNodeRegMask(), hasDataDependencyPred(), hasDataSucc(), hasOnlyLiveInOpers(), hasOnlyLiveOutUses(), hasVRegCycleUse(), llvm::ScheduleDAGTopologicalSort::InitDAGTopologicalSorting(), INITIALIZE_PASS(), initVRegCycle(), llvm::SwingSchedulerDAG::isBackedge(), llvm::SwingSchedulerDAG::isLoopCarriedDep(), isOperandOf(), llvm::SMSchedule::isValidSchedule(), llvm::SchedDFSImpl::joinPredSubtree(), llvm::SMSchedule::latestCycleInChain(), llvm::resource_sort::operator()(), llvm::ResourcePriorityQueue::push(), llvm::ScheduleDAGMI::releasePred(), llvm::ScheduleDAGMI::releaseSucc(), llvm::ConvergingVLIWScheduler::releaseTopNode(), llvm::SUnit::removePred(), resetVRegCycle(), llvm::ResourcePriorityQueue::ResourcePriorityQueue(), llvm::SIScheduleBlock::schedule(), llvm::ResourcePriorityQueue::scheduledNode(), llvm::ConvergingVLIWScheduler::SchedulingCost(), llvm::SUnit::setDepthDirty(), llvm::SUnit::setHeightDirty(), llvm::SUnit::setHeightToAtLeast(), setLatency(), llvm::SIScheduleDAGMI::SIScheduleDAGMI(), swapAntiDependences(), llvm::SchedDFSImpl::visitCrossEdge(), llvm::SchedDFSImpl::visitPostorderEdge(), llvm::SchedDFSImpl::visitPostorderNode(), and llvm::ScheduleDAGTopologicalSort::WillCreateCycle().
|
inline |
Tests if this is an Order dependence that is marked as "artificial", meaning it isn't necessary for correctness.
Definition at line 201 of file ScheduleDAG.h.
References Artificial, getKind(), and Order.
Referenced by llvm::ScheduleDAGMI::addEdge(), ignoreDependence(), llvm::SwingSchedulerDAG::isLoopCarriedDep(), isOperandOf(), and llvm::HexagonSubtarget::usePredicatedCalls().
|
inline |
Tests if this is a Data dependence that is associated with a register.
Definition at line 212 of file ScheduleDAG.h.
References Data, and getKind().
Referenced by canClobberPhysRegDefs(), canClobberReachingPhysRegUse(), CheckForLiveRegDef(), FindCallSeqStart(), getNodeRegMask(), llvm::ConvergingVLIWScheduler::SchedulingCost(), and llvm::ScheduleDAGTopologicalSort::WillCreateCycle().
|
inline |
Tests if this is an Order dependence that is marked as a barrier.
Definition at line 175 of file ScheduleDAG.h.
References Barrier, getKind(), and Order.
Referenced by isNormalMemoryOrBarrier().
|
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 207 of file ScheduleDAG.h.
References Cluster, getKind(), and Order.
Referenced by fuseInstructionPair(), llvm::ScheduleDAGMI::releasePred(), and llvm::ScheduleDAGMI::releaseSucc().
|
inline |
Shorthand for getKind() != SDep::Data.
Definition at line 162 of file ScheduleDAG.h.
References Data, and getKind().
Referenced by calcMaxScratches(), CalcNodeSethiUllmanNumber(), canClobberPhysRegDefs(), closestSucc(), hasDataDependencyPred(), hasOnlyLiveInOpers(), hasOnlyLiveOutUses(), hasVRegCycleUse(), initVRegCycle(), isOperandOf(), numberCtrlDepsInSU(), numberCtrlPredInSU(), resetVRegCycle(), llvm::ResourcePriorityQueue::ResourcePriorityQueue(), and llvm::ResourcePriorityQueue::scheduledNode().
|
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 187 of file ScheduleDAG.h.
References getKind(), MustAliasMem, and Order.
|
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 169 of file ScheduleDAG.h.
References getKind(), MayAliasMem, MustAliasMem, and Order.
Referenced by isNormalMemoryOrBarrier().
|
inline |
Tests if this is could be any kind of memory dependence.
Definition at line 180 of file ScheduleDAG.h.
References isBarrier(), and isNormalMemory().
|
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 195 of file ScheduleDAG.h.
References getKind(), Order, and Weak.
Referenced by llvm::SUnit::addPred(), fuseInstructionPair(), hasDataDependencyPred(), INITIALIZE_PASS(), llvm::ScheduleDAGMI::releasePred(), llvm::ScheduleDAGMI::releaseSucc(), llvm::SUnit::removePred(), and llvm::SIScheduleBlock::schedule().
Definition at line 136 of file ScheduleDAG.h.
References operator==().
Definition at line 132 of file ScheduleDAG.h.
References overlaps().
Referenced by operator!=(), and llvm::SUnitIterator::operator!=().
Returns true if the specified SDep is equivalent except for latency.
Definition at line 469 of file ScheduleDAG.h.
References Anti, Data, llvm_unreachable, Order, OrdKind, Output, and Reg.
Referenced by operator==(), and SDep().
|
inline |
Sets the latency for this edge.
Definition at line 148 of file ScheduleDAG.h.
References getKind(), getSUnit(), and setSUnit().
Referenced by llvm::ScheduleDAGInstrs::addChainDependency(), llvm::ScheduleDAGInstrs::addPhysRegDataDeps(), llvm::ScheduleDAGInstrs::addPhysRegDeps(), llvm::SUnit::addPred(), llvm::SUnit::addPredBarrier(), llvm::ScheduleDAGInstrs::addVRegDefDeps(), llvm::HexagonSubtarget::adjustSchedDependency(), llvm::HexagonSubtarget::HVXMemLatencyMutation::apply(), llvm::HexagonSubtarget::BankConflictMutation::apply(), llvm::ScheduleDAGInstrs::buildSchedGraph(), llvm::ScheduleDAGSDNodes::computeOperandLatency(), fuseInstructionPair(), getUnderlyingObjects(), isOperandOf(), swapAntiDependences(), and llvm::HexagonSubtarget::usePredicatedCalls().
|
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 229 of file ScheduleDAG.h.
References Anti, assert(), Data, dump(), getKind(), Output, Reg, and TRI.
|
inline |
Definition at line 487 of file ScheduleDAG.h.
Referenced by llvm::SUnit::addPred(), canClobberPhysRegDefs(), isOperandOf(), llvm::SUnit::removePred(), setLatency(), and llvm::HexagonSubtarget::usePredicatedCalls().
unsigned llvm::SDep::OrdKind |
Additional information about Order dependencies.
Definition at line 91 of file ScheduleDAG.h.
Referenced by overlaps().
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 88 of file ScheduleDAG.h.
Referenced by overlaps(), SDep(), and setReg().