LLVM  10.0.0svn
Public Types | Public Member Functions | Protected Member Functions | List of all members
llvm::DDGNode Class Referenceabstract

Data Dependence Graph Node The graph can represent the following types of nodes: More...

#include "llvm/Analysis/DDG.h"

Inheritance diagram for llvm::DDGNode:
Inheritance graph
[legend]
Collaboration diagram for llvm::DDGNode:
Collaboration graph
[legend]

Public Types

enum  NodeKind { NodeKind::Unknown, NodeKind::SingleInstruction, NodeKind::MultiInstruction, NodeKind::Root }
 
using InstructionListType = SmallVectorImpl< Instruction * >
 
- Public Types inherited from llvm::DGNode< NodeType, EdgeType >
using EdgeListTy = SetVector< EdgeType * >
 
using iterator = typename EdgeListTy::iterator
 
using const_iterator = typename EdgeListTy::const_iterator
 

Public Member Functions

 DDGNode ()=delete
 
 DDGNode (const NodeKind K)
 
 DDGNode (const DDGNode &N)
 
 DDGNode (DDGNode &&N)
 
virtual ~DDGNode ()=0
 
DDGNodeoperator= (const DDGNode &N)
 
DDGNodeoperator= (DDGNode &&N)
 
NodeKind getKind () const
 Getter for the kind of this node. More...
 
bool collectInstructions (llvm::function_ref< bool(Instruction *)> const &Pred, InstructionListType &IList) const
 Collect a list of instructions, in IList, for which predicate Pred evaluates to true when iterating over instructions of this node. More...
 
- Public Member Functions inherited from llvm::DGNode< NodeType, EdgeType >
 DGNode (EdgeType &E)
 Create a node with a single outgoing edge E. More...
 
 DGNode ()=default
 
 DGNode (const DGNode< NodeType, EdgeType > &N)
 
 DGNode (DGNode< NodeType, EdgeType > &&N)
 
DGNode< NodeType, EdgeType > & operator= (const DGNode< NodeType, EdgeType > &N)
 
DGNode< NodeType, EdgeType > & operator= (const DGNode< NodeType, EdgeType > &&N)
 
bool operator== (const NodeType &N) const
 Static polymorphism: delegate implementation (via isEqualTo) to the derived class. More...
 
bool operator!= (const NodeType &N) const
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
const EdgeType & front () const
 
EdgeType & front ()
 
const EdgeType & back () const
 
EdgeType & back ()
 
bool findEdgesTo (const NodeType &N, SmallVectorImpl< EdgeType *> &EL) const
 Collect in EL, all the edges from this node to N. More...
 
bool addEdge (EdgeType &E)
 Add the given edge E to this node, if it doesn't exist already. More...
 
void removeEdge (EdgeType &E)
 Remove the given edge E from this node, if it exists. More...
 
bool hasEdgeTo (const NodeType &N) const
 Test whether there is an edge that goes from this node to N. More...
 
const EdgeListTygetEdges () const
 Retrieve the outgoing edges for the node. More...
 
EdgeListTygetEdges ()
 
void clear ()
 Clear the outgoing edges. More...
 

Protected Member Functions

void setKind (NodeKind K)
 Setter for the kind of this node. More...
 
- Protected Member Functions inherited from llvm::DGNode< NodeType, EdgeType >
bool isEqualTo (const NodeType &N) const
 
NodeType & getDerived ()
 
const NodeType & getDerived () const
 
const_iterator findEdgeTo (const NodeType &N) const
 Find an edge to N. More...
 

Additional Inherited Members

- Protected Attributes inherited from llvm::DGNode< NodeType, EdgeType >
EdgeListTy Edges
 

Detailed Description

Data Dependence Graph Node The graph can represent the following types of nodes:

  1. Single instruction node containing just one instruction.
  2. Multiple instruction node where two or more instructions from the same basic block are merged into one node.
  3. Root node is a special node that connects to all components such that there is always a path from it to any node in the graph.

Definition at line 38 of file DDG.h.

Member Typedef Documentation

◆ InstructionListType

Definition at line 40 of file DDG.h.

Member Enumeration Documentation

◆ NodeKind

Enumerator
Unknown 
SingleInstruction 
MultiInstruction 
Root 

Definition at line 42 of file DDG.h.

Constructor & Destructor Documentation

◆ DDGNode() [1/4]

llvm::DDGNode::DDGNode ( )
delete

◆ DDGNode() [2/4]

llvm::DDGNode::DDGNode ( const NodeKind  K)
inline

Definition at line 50 of file DDG.h.

◆ DDGNode() [3/4]

llvm::DDGNode::DDGNode ( const DDGNode N)
inline

Definition at line 51 of file DDG.h.

◆ DDGNode() [4/4]

llvm::DDGNode::DDGNode ( DDGNode &&  N)
inline

Definition at line 52 of file DDG.h.

References ~DDGNode().

◆ ~DDGNode()

DDGNode::~DDGNode ( )
pure virtual

Definition at line 25 of file DDG.cpp.

Referenced by DDGNode().

Member Function Documentation

◆ collectInstructions()

bool DDGNode::collectInstructions ( llvm::function_ref< bool(Instruction *)> const Pred,
InstructionListType IList 
) const

Collect a list of instructions, in IList, for which predicate Pred evaluates to true when iterating over instructions of this node.

Return true if at least one instruction was collected, and false otherwise.

Definition at line 27 of file DDG.cpp.

References assert(), llvm::SmallVectorBase::empty(), I, llvm_unreachable, and llvm::SmallVectorTemplateBase< T, bool >::push_back().

Referenced by getKind().

◆ getKind()

NodeKind llvm::DDGNode::getKind ( ) const
inline

Getter for the kind of this node.

Definition at line 68 of file DDG.h.

References collectInstructions().

Referenced by llvm::RootDDGNode::classof(), llvm::SimpleDDGNode::classof(), llvm::operator<<(), and llvm::SimpleDDGNode::SimpleDDGNode().

◆ operator=() [1/2]

DDGNode& llvm::DDGNode::operator= ( const DDGNode N)
inline

Definition at line 55 of file DDG.h.

References llvm::DGNode< NodeType, EdgeType >::operator=().

Referenced by llvm::SimpleDDGNode::operator=().

◆ operator=() [2/2]

DDGNode& llvm::DDGNode::operator= ( DDGNode &&  N)
inline

Definition at line 61 of file DDG.h.

References N, and llvm::DGNode< NodeType, EdgeType >::operator=().

◆ setKind()

void llvm::DDGNode::setKind ( NodeKind  K)
inlineprotected

Setter for the kind of this node.

Definition at line 78 of file DDG.h.

Referenced by llvm::SimpleDDGNode::classof().


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