LLVM 24.0.0git
llvm::sandboxir::MemDGNode Class Referencefinal

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"

Inheritance diagram for llvm::sandboxir::MemDGNode:
[legend]

Public Member Functions

 MemDGNode (Instruction *I)
iterator preds_begin (DependencyGraph &DAG) override
iterator preds_end (DependencyGraph &DAG) override
succ_iterator succs_begin (DependencyGraph &DAG) override
succ_iterator succs_end (DependencyGraph &DAG) override
MemDGNodegetPrevNode () const
 \Returns the previous Mem DGNode in instruction order.
MemDGNodegetNextNode () const
 \Returns the next Mem DGNode in instruction order.
void addMemPred (MemDGNode *PredN, SchedDirection Dir)
 Adds the mem dependency edge PredN->this.
void removeMemPred (MemDGNode *PredN, SchedDirection Dir)
 Removes the memory dependency PredN->this.
bool hasMemPred (DGNode *N) const
 \Returns true if there is a memory dependency N->this.
iterator_range< DenseSet< MemDGNode * >::const_iteratormemPreds () const
 \Returns all memory dependency predecessors. Used by tests.
iterator_range< DenseSet< MemDGNode * >::const_iteratormemSuccs () const
 \Returns all memory dependency successors.
void print (raw_ostream &OS, bool PrintDeps=true) const override
Public Member Functions inherited from llvm::sandboxir::DGNode
 DGNode (Instruction *I)
 DGNode (const DGNode &Other)=delete
virtual ~DGNode ()
unsigned getNumUnscheduledDeps () const
 \Returns the number of unscheduled successors.
bool validUnscheduledDeps () const
void decrUnscheduledDeps ()
void incrUnscheduledDeps ()
void resetScheduleState ()
bool ready () const
 \Returns true if all dependent successors (or predecessors during top-down scheduling) have been scheduled.
bool scheduled () const
 \Returns true if this node has been scheduled.
void setScheduled ()
SchedBundlegetSchedBundle () 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.
iterator preds_begin (DependencyGraph &DAG) const
iterator preds_end (DependencyGraph &DAG) const
iterator_range< iteratorpreds (DependencyGraph &DAG) const
 \Returns a range of DAG predecessors nodes.
succ_iterator succs_begin (DependencyGraph &DAG) const
succ_iterator succs_end (DependencyGraph &DAG) const
iterator_range< succ_iteratorsuccs (DependencyGraph &DAG) const
 \Returns a range of DAG successor nodes.
InstructiongetInstruction () const
LLVM_DUMP_METHOD void dump () const

Static Public Member Functions

static bool classof (const DGNode *Other)
Static Public Member Functions inherited from llvm::sandboxir::DGNode
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 SuccIterator
class DependencyGraph

Additional Inherited Members

Public Types inherited from llvm::sandboxir::DGNode
using iterator = PredIterator
using succ_iterator = SuccIterator
Protected Member Functions inherited from llvm::sandboxir::DGNode
void setSchedBundle (SchedBundle &SB)
void clearSchedBundle ()
 DGNode (Instruction *I, DGNodeID ID)
Protected Attributes inherited from llvm::sandboxir::DGNode
InstructionI
DGNodeID SubclassID
 For isa/dyn_cast etc.
std::optional< unsignedUnscheduledDeps = 0
 The number of unscheduled successors (predecessors) depending on the scheduling direction.
bool Scheduled = false
 This is true if this node has been scheduled.
SchedBundleSB = nullptr
 The scheduler bundle that this node belongs to.

Detailed Description

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 311 of file DependencyGraph.h.

Constructor & Destructor Documentation

◆ MemDGNode()

Member Function Documentation

◆ addMemPred()

void llvm::sandboxir::MemDGNode::addMemPred ( MemDGNode * PredN,
SchedDirection Dir )
inline

Adds the mem dependency edge PredN->this.

This also increments the UnscheduledDeps counter of the predecessor if this node has not been scheduled.

Definition at line 378 of file DependencyGraph.h.

References assert(), llvm::sandboxir::BottomUp, llvm::sandboxir::DGNode::incrUnscheduledDeps(), MemDGNode(), and llvm::sandboxir::DGNode::Scheduled.

◆ classof()

bool llvm::sandboxir::MemDGNode::classof ( const DGNode * Other)
inlinestatic

◆ getNextNode()

MemDGNode * llvm::sandboxir::MemDGNode::getNextNode ( ) const
inline

\Returns the next Mem DGNode in instruction order.

Definition at line 372 of file DependencyGraph.h.

References MemDGNode().

◆ getPrevNode()

MemDGNode * llvm::sandboxir::MemDGNode::getPrevNode ( ) const
inline

\Returns the previous Mem DGNode in instruction order.

Definition at line 370 of file DependencyGraph.h.

References MemDGNode().

◆ hasMemPred()

bool llvm::sandboxir::MemDGNode::hasMemPred ( DGNode * N) const
inline

\Returns true if there is a memory dependency N->this.

Definition at line 408 of file DependencyGraph.h.

References llvm::sandboxir::DGNode::DGNode(), llvm::dyn_cast(), and N.

◆ memPreds()

iterator_range< DenseSet< MemDGNode * >::const_iterator > llvm::sandboxir::MemDGNode::memPreds ( ) const
inline

\Returns all memory dependency predecessors. Used by tests.

Definition at line 414 of file DependencyGraph.h.

References llvm::make_range().

◆ memSuccs()

iterator_range< DenseSet< MemDGNode * >::const_iterator > llvm::sandboxir::MemDGNode::memSuccs ( ) const
inline

\Returns all memory dependency successors.

Definition at line 418 of file DependencyGraph.h.

References llvm::make_range().

◆ preds_begin()

iterator llvm::sandboxir::MemDGNode::preds_begin ( DependencyGraph & DAG)
inlineoverridevirtual

Reimplemented from llvm::sandboxir::DGNode.

Definition at line 351 of file DependencyGraph.h.

References DependencyGraph, llvm::sandboxir::DGNode::I, and PredIterator.

◆ preds_end()

iterator llvm::sandboxir::MemDGNode::preds_end ( DependencyGraph & DAG)
inlineoverridevirtual

Reimplemented from llvm::sandboxir::DGNode.

Definition at line 356 of file DependencyGraph.h.

References DependencyGraph, llvm::sandboxir::DGNode::I, and PredIterator.

◆ print()

void llvm::sandboxir::MemDGNode::print ( raw_ostream & OS,
bool PrintDeps = true ) const
overridevirtual

Reimplemented from llvm::sandboxir::DGNode.

Definition at line 165 of file DependencyGraph.cpp.

References llvm::raw_ostream::indent(), and llvm::sandboxir::DGNode::print().

◆ removeMemPred()

void llvm::sandboxir::MemDGNode::removeMemPred ( MemDGNode * PredN,
SchedDirection Dir )
inline

Removes the memory dependency PredN->this.

This also updates the UnscheduledSuccs counter of PredN if this node has not been scheduled.

Definition at line 394 of file DependencyGraph.h.

References llvm::sandboxir::BottomUp, llvm::sandboxir::DGNode::decrUnscheduledDeps(), MemDGNode(), and llvm::sandboxir::DGNode::Scheduled.

◆ succs_begin()

succ_iterator llvm::sandboxir::MemDGNode::succs_begin ( DependencyGraph & DAG)
inlineoverridevirtual

Reimplemented from llvm::sandboxir::DGNode.

Definition at line 359 of file DependencyGraph.h.

References DependencyGraph, llvm::sandboxir::DGNode::I, and SuccIterator.

◆ succs_end()

succ_iterator llvm::sandboxir::MemDGNode::succs_end ( DependencyGraph & DAG)
inlineoverridevirtual

Reimplemented from llvm::sandboxir::DGNode.

Definition at line 365 of file DependencyGraph.h.

References DependencyGraph, llvm::sandboxir::DGNode::I, and SuccIterator.

◆ DependencyGraph

friend class DependencyGraph
friend

Definition at line 334 of file DependencyGraph.h.

References DependencyGraph.

Referenced by DependencyGraph, preds_begin(), preds_end(), succs_begin(), and succs_end().

◆ PredIterator

friend class PredIterator
friend

Definition at line 318 of file DependencyGraph.h.

References PredIterator.

Referenced by PredIterator, preds_begin(), and preds_end().

◆ SuccIterator

friend class SuccIterator
friend

Definition at line 319 of file DependencyGraph.h.

References assert(), MemDGNode(), N, and SuccIterator.

Referenced by SuccIterator, succs_begin(), and succs_end().


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