LLVM 20.0.0git
|
A DependencyGraph Node for instructions that may read/write memory, or have some ordering constraints, like with stacksave/stackrestore and alloca/inalloca. More...
#include "llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h"
Public Member Functions | |
MemDGNode (Instruction *I) | |
iterator | preds_begin (DependencyGraph &DAG) override |
iterator | preds_end (DependencyGraph &DAG) override |
MemDGNode * | getPrevNode () const |
\Returns the previous Mem DGNode in instruction order. | |
MemDGNode * | getNextNode () const |
\Returns the next Mem DGNode in instruction order. | |
void | addMemPred (MemDGNode *PredN) |
Adds the mem dependency edge PredN->this. | |
bool | hasMemPred (DGNode *N) const |
\Returns true if there is a memory dependency N->this. | |
iterator_range< DenseSet< MemDGNode * >::const_iterator > | memPreds () const |
\Returns all memory dependency predecessors. Used by tests. | |
virtual void | print (raw_ostream &OS, bool PrintDeps=true) const override |
![]() | |
DGNode (Instruction *I) | |
DGNode (const DGNode &Other)=delete | |
virtual | ~DGNode () |
unsigned | getNumUnscheduledSuccs () const |
\Returns the number of unscheduled successors. | |
void | decrUnscheduledSuccs () |
bool | ready () const |
\Returns true if all dependent successors have been scheduled. | |
bool | scheduled () const |
\Returns true if this node has been scheduled. | |
void | setScheduled (bool NewVal) |
SchedBundle * | getSchedBundle () const |
\Returns the scheduling bundle that this node belongs to, or nullptr. | |
bool | comesBefore (const DGNode *Other) |
\Returns true if this is before Other in program order. | |
virtual iterator | preds_begin (DependencyGraph &DAG) |
virtual iterator | preds_end (DependencyGraph &DAG) |
iterator | preds_begin (DependencyGraph &DAG) const |
iterator | preds_end (DependencyGraph &DAG) const |
iterator_range< iterator > | preds (DependencyGraph &DAG) const |
\Returns a range of DAG predecessors nodes. | |
Instruction * | getInstruction () const |
virtual void | print (raw_ostream &OS, bool PrintDeps=true) const |
LLVM_DUMP_METHOD void | dump () const |
Static Public Member Functions | |
static bool | classof (const DGNode *Other) |
![]() | |
static bool | isStackSaveOrRestoreIntrinsic (Instruction *I) |
static bool | isMemIntrinsic (IntrinsicInst *I) |
\Returns true if intrinsic I touches memory. | |
static bool | isMemDepCandidate (Instruction *I) |
We consider I as a Memory Dependency Candidate instruction if it reads/write memory or if it has side-effects. | |
static bool | isFenceLike (Instruction *I) |
\Returns true if I is fence like. It excludes non-mem intrinsics. | |
static bool | isMemDepNodeCandidate (Instruction *I) |
\Returns true if I is a memory dependency candidate instruction. | |
Friends | |
class | PredIterator |
class | DependencyGraph |
Additional Inherited Members | |
![]() | |
using | iterator = PredIterator |
![]() | |
void | setSchedBundle (SchedBundle &SB) |
void | clearSchedBundle () |
DGNode (Instruction *I, DGNodeID ID) | |
![]() | |
Instruction * | I |
DGNodeID | SubclassID |
For isa/dyn_cast etc. | |
unsigned | UnscheduledSuccs = 0 |
The number of unscheduled successors. | |
bool | Scheduled = false |
This is true if this node has been scheduled. | |
SchedBundle * | SB = nullptr |
The scheduler bundle that this node belongs to. | |
A DependencyGraph Node for instructions that may read/write memory, or have some ordering constraints, like with stacksave/stackrestore and alloca/inalloca.
Definition at line 213 of file DependencyGraph.h.
|
inline |
Definition at line 233 of file DependencyGraph.h.
References assert(), llvm::sandboxir::DGNode::I, and llvm::sandboxir::DGNode::isMemDepNodeCandidate().
|
inline |
Adds the mem dependency edge PredN->this.
This also increments the UnscheduledSuccs counter of the predecessor if this node has not been scheduled.
Definition at line 254 of file DependencyGraph.h.
References assert(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), llvm::sandboxir::DGNode::Scheduled, and llvm::sandboxir::DGNode::UnscheduledSuccs.
Definition at line 236 of file DependencyGraph.h.
References llvm::sandboxir::MemDGNode, and llvm::Other.
|
inline |
\Returns the next Mem DGNode in instruction order.
Definition at line 250 of file DependencyGraph.h.
|
inline |
\Returns the previous Mem DGNode in instruction order.
Definition at line 248 of file DependencyGraph.h.
\Returns true if there is a memory dependency N->this.
Definition at line 262 of file DependencyGraph.h.
References llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::count(), and N.
|
inline |
\Returns all memory dependency predecessors. Used by tests.
Definition at line 268 of file DependencyGraph.h.
References llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::begin(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::end(), and llvm::make_range().
|
inlineoverridevirtual |
Reimplemented from llvm::sandboxir::DGNode.
Definition at line 239 of file DependencyGraph.h.
References llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::begin(), llvm::sandboxir::DGNode::I, llvm::sandboxir::User::op_begin(), llvm::sandboxir::User::op_end(), PredIterator, and llvm::sandboxir::skipNonInstr().
|
inlineoverridevirtual |
Reimplemented from llvm::sandboxir::DGNode.
Definition at line 244 of file DependencyGraph.h.
References llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::end(), llvm::sandboxir::DGNode::I, llvm::sandboxir::User::op_end(), and PredIterator.
|
overridevirtual |
Reimplemented from llvm::sandboxir::DGNode.
Definition at line 73 of file DependencyGraph.cpp.
References OS, and llvm::sandboxir::DGNode::print().
|
friend |
Definition at line 222 of file DependencyGraph.h.
|
friend |
Definition at line 218 of file DependencyGraph.h.
Referenced by preds_begin(), and preds_end().