LLVM 20.0.0git
|
A DependencyGraph Node that points to an Instruction and contains memory dependency edges. More...
#include "llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h"
Public Types | |
using | iterator = PredIterator |
Public Member Functions | |
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 | 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. | |
Protected Member Functions | |
void | setSchedBundle (SchedBundle &SB) |
void | clearSchedBundle () |
DGNode (Instruction *I, DGNodeID ID) | |
Protected Attributes | |
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. | |
Friends | |
class | SchedBundle |
class | MemDGNode |
class | DependencyGraph |
raw_ostream & | operator<< (raw_ostream &OS, DGNode &N) |
A DependencyGraph Node that points to an Instruction and contains memory dependency edges.
Definition at line 94 of file DependencyGraph.h.
Definition at line 136 of file DependencyGraph.h.
|
inlineprotected |
Definition at line 111 of file DependencyGraph.h.
|
inline |
Definition at line 116 of file DependencyGraph.h.
References assert(), I, and isMemDepNodeCandidate().
|
virtual |
Definition at line 62 of file DependencyGraph.cpp.
References SB.
|
inlineprotected |
Definition at line 108 of file DependencyGraph.h.
\Returns true if this is before Other
in program order.
Definition at line 135 of file DependencyGraph.h.
References llvm::sandboxir::Instruction::comesBefore(), I, and llvm::Other.
|
inline |
Definition at line 123 of file DependencyGraph.h.
References assert(), and UnscheduledSuccs.
void llvm::sandboxir::DGNode::dump | ( | ) | const |
Definition at line 72 of file DependencyGraph.cpp.
References llvm::dbgs(), and print().
|
inline |
Definition at line 198 of file DependencyGraph.h.
References I.
Referenced by llvm::sandboxir::SchedBundle::getBot(), llvm::sandboxir::SchedBundle::getTop(), llvm::sandboxir::PriorityCmp::operator()(), and llvm::sandboxir::DependencyGraph::print().
|
inline |
\Returns the number of unscheduled successors.
Definition at line 122 of file DependencyGraph.h.
References UnscheduledSuccs.
|
inline |
\Returns the scheduling bundle that this node belongs to, or nullptr.
Definition at line 133 of file DependencyGraph.h.
References SB.
|
inlinestatic |
\Returns true if I
is fence like. It excludes non-mem intrinsics.
Definition at line 183 of file DependencyGraph.h.
References I, II, llvm::sandboxir::Instruction::isFenceLike(), and isMemIntrinsic().
Referenced by isMemDepNodeCandidate(), and llvm::sandboxir::isOrdered().
|
inlinestatic |
We consider I
as a Memory Dependency Candidate instruction if it reads/write memory or if it has side-effects.
This is used by the dependency graph.
Definition at line 176 of file DependencyGraph.h.
References I, II, isMemIntrinsic(), and llvm::sandboxir::Instruction::mayReadOrWriteMemory().
Referenced by isMemDepNodeCandidate(), and llvm::sandboxir::isOrdered().
|
inlinestatic |
\Returns true if I
is a memory dependency candidate instruction.
Definition at line 190 of file DependencyGraph.h.
References I, isFenceLike(), isMemDepCandidate(), isStackSaveOrRestoreIntrinsic(), and llvm::sandboxir::AllocaInst::isUsedWithInAlloca().
Referenced by DGNode(), llvm::sandboxir::MemDGNodeIntervalBuilder::getBotMemDGNode(), llvm::sandboxir::DependencyGraph::getOrCreateNode(), llvm::sandboxir::MemDGNodeIntervalBuilder::getTopMemDGNode(), and llvm::sandboxir::MemDGNode::MemDGNode().
|
inlinestatic |
\Returns true if intrinsic I
touches memory.
This is used by the dependency graph.
Definition at line 168 of file DependencyGraph.h.
References I.
Referenced by isFenceLike(), and isMemDepCandidate().
|
inlinestatic |
Definition at line 158 of file DependencyGraph.h.
Referenced by isMemDepNodeCandidate().
|
inline |
\Returns a range of DAG predecessors nodes.
If this is a MemDGNode then this will also include the memory dependency predecessors. Please note that this can include the same node more than once, if for example it's both a use-def predecessor and a mem dep predecessor.
Definition at line 154 of file DependencyGraph.h.
References llvm::make_range(), preds_begin(), and preds_end().
|
inlinevirtual |
Reimplemented in llvm::sandboxir::MemDGNode.
Definition at line 137 of file DependencyGraph.h.
References I, llvm::sandboxir::User::op_begin(), llvm::sandboxir::User::op_end(), and llvm::sandboxir::skipNonInstr().
Referenced by preds(), and preds_begin().
|
inline |
Definition at line 144 of file DependencyGraph.h.
References preds_begin().
|
inlinevirtual |
Reimplemented in llvm::sandboxir::MemDGNode.
Definition at line 141 of file DependencyGraph.h.
References I, and llvm::sandboxir::User::op_end().
Referenced by preds(), and preds_end().
|
inline |
Definition at line 147 of file DependencyGraph.h.
References preds_end().
|
virtual |
Reimplemented in llvm::sandboxir::MemDGNode.
Definition at line 69 of file DependencyGraph.cpp.
References I, OS, Scheduled, and UnscheduledSuccs.
Referenced by dump(), and llvm::sandboxir::MemDGNode::print().
|
inline |
\Returns true if all dependent successors have been scheduled.
Definition at line 128 of file DependencyGraph.h.
References UnscheduledSuccs.
|
inline |
\Returns true if this node has been scheduled.
Definition at line 130 of file DependencyGraph.h.
References Scheduled.
|
inlineprotected |
Definition at line 107 of file DependencyGraph.h.
References SB.
|
inline |
Definition at line 131 of file DependencyGraph.h.
References Scheduled.
|
friend |
Definition at line 113 of file DependencyGraph.h.
|
friend |
Definition at line 112 of file DependencyGraph.h.
|
friend |
Definition at line 202 of file DependencyGraph.h.
|
friend |
Definition at line 109 of file DependencyGraph.h.
|
protected |
Definition at line 96 of file DependencyGraph.h.
Referenced by comesBefore(), DGNode(), getInstruction(), isFenceLike(), isMemDepCandidate(), isMemDepNodeCandidate(), isMemIntrinsic(), isStackSaveOrRestoreIntrinsic(), llvm::sandboxir::MemDGNode::MemDGNode(), preds_begin(), llvm::sandboxir::MemDGNode::preds_begin(), preds_end(), llvm::sandboxir::MemDGNode::preds_end(), and print().
|
protected |
The scheduler bundle that this node belongs to.
Definition at line 105 of file DependencyGraph.h.
Referenced by getSchedBundle(), setSchedBundle(), and ~DGNode().
|
protected |
This is true if this node has been scheduled.
Definition at line 103 of file DependencyGraph.h.
Referenced by llvm::sandboxir::MemDGNode::addMemPred(), print(), scheduled(), and setScheduled().
|
protected |
For isa/dyn_cast etc.
Definition at line 99 of file DependencyGraph.h.
|
protected |
The number of unscheduled successors.
Definition at line 101 of file DependencyGraph.h.
Referenced by llvm::sandboxir::MemDGNode::addMemPred(), decrUnscheduledSuccs(), getNumUnscheduledSuccs(), print(), and ready().