CIRCT  20.0.0git
Public Types | Public Member Functions | Private Attributes | List of all members
circt::scheduling::detail::Dependence Class Reference

A wrapper class to uniformly handle def-use and auxiliary dependence edges. More...

#include <DependenceIterator.h>

Collaboration diagram for circt::scheduling::detail::Dependence:
Collaboration graph
[legend]

Public Types

using TupleRepr = std::tuple< Operation *, Operation *, std::optional< unsigned >, std::optional< unsigned > >
 The "expanded" representation of a dependence, intended as the key for comparisons and hashing. More...
 

Public Member Functions

 Dependence (OpOperand *defUseDep)
 Wrap a def-use dependence, which is uniquely identified in the SSA graph by an OpOperand. More...
 
 Dependence (std::pair< Operation *, Operation * > auxDep)
 Wrap an auxiliary dependence, identified by the pair of its endpoints. More...
 
 Dependence (Operation *from, Operation *to)
 Wrap an auxiliary dependence between from and to. More...
 
 Dependence ()
 Construct an invalid dependence. More...
 
bool isAuxiliary () const
 Return true if this is a valid auxiliary dependence. More...
 
bool isDefUse () const
 Return true if this is a valid def-use dependence. More...
 
bool isInvalid () const
 Return true if this is an invalid dependence. More...
 
Operation * getSource () const
 Return the source of the dependence. More...
 
Operation * getDestination () const
 Return the destination of the dependence. More...
 
std::optional< unsigned > getSourceIndex () const
 Return the source operation's result number, if applicable. More...
 
std::optional< unsigned > getDestinationIndex () const
 Return the destination operation's operand number, if applicable. More...
 
TupleRepr getAsTuple () const
 Return the tuple representation of this dependence. More...
 
bool operator== (const Dependence &other) const
 

Private Attributes

Operation * auxSrc
 
union {
   Operation *   auxDst
 
   OpOperand *   defUse
 
}; 
 

Detailed Description

A wrapper class to uniformly handle def-use and auxiliary dependence edges.

Should be small enough (two pointers) to be passed around by value.

Definition at line 34 of file DependenceIterator.h.

Member Typedef Documentation

◆ TupleRepr

using circt::scheduling::detail::Dependence::TupleRepr = std::tuple<Operation *, Operation *, std::optional<unsigned>, std::optional<unsigned> >

The "expanded" representation of a dependence, intended as the key for comparisons and hashing.

Definition at line 38 of file DependenceIterator.h.

Constructor & Destructor Documentation

◆ Dependence() [1/4]

circt::scheduling::detail::Dependence::Dependence ( OpOperand *  defUseDep)
inline

Wrap a def-use dependence, which is uniquely identified in the SSA graph by an OpOperand.

Definition at line 44 of file DependenceIterator.h.

◆ Dependence() [2/4]

circt::scheduling::detail::Dependence::Dependence ( std::pair< Operation *, Operation * >  auxDep)
inline

Wrap an auxiliary dependence, identified by the pair of its endpoints.

Definition at line 46 of file DependenceIterator.h.

◆ Dependence() [3/4]

circt::scheduling::detail::Dependence::Dependence ( Operation *  from,
Operation *  to 
)
inline

Wrap an auxiliary dependence between from and to.

Definition at line 49 of file DependenceIterator.h.

◆ Dependence() [4/4]

circt::scheduling::detail::Dependence::Dependence ( )
inline

Construct an invalid dependence.

Definition at line 51 of file DependenceIterator.h.

Member Function Documentation

◆ getAsTuple()

Dependence::TupleRepr Dependence::getAsTuple ( ) const

Return the tuple representation of this dependence.

Definition at line 467 of file Problems.cpp.

References getDestination(), getDestinationIndex(), getSource(), and getSourceIndex().

Referenced by llvm::DenseMapInfo< Dependence >::getHashValue(), and operator==().

◆ getDestination()

Operation * Dependence::getDestination ( ) const

◆ getDestinationIndex()

std::optional< unsigned > Dependence::getDestinationIndex ( ) const

Return the destination operation's operand number, if applicable.

Definition at line 461 of file Problems.cpp.

References defUse, and isDefUse().

Referenced by getAsTuple().

◆ getSource()

Operation * Dependence::getSource ( ) const

◆ getSourceIndex()

std::optional< unsigned > Dependence::getSourceIndex ( ) const

Return the source operation's result number, if applicable.

Definition at line 453 of file Problems.cpp.

References assert(), defUse, and isDefUse().

Referenced by getAsTuple().

◆ isAuxiliary()

bool circt::scheduling::detail::Dependence::isAuxiliary ( ) const
inline

◆ isDefUse()

bool circt::scheduling::detail::Dependence::isDefUse ( ) const
inline

Return true if this is a valid def-use dependence.

Definition at line 56 of file DependenceIterator.h.

References auxDst, and auxSrc.

Referenced by getDestination(), getDestinationIndex(), getSource(), and getSourceIndex().

◆ isInvalid()

bool circt::scheduling::detail::Dependence::isInvalid ( ) const
inline

Return true if this is an invalid dependence.

Definition at line 58 of file DependenceIterator.h.

References auxDst.

◆ operator==()

bool Dependence::operator== ( const Dependence other) const

Definition at line 472 of file Problems.cpp.

References getAsTuple().

Member Data Documentation

◆ 

union { ... }

◆ auxDst

Operation* circt::scheduling::detail::Dependence::auxDst

Definition at line 78 of file DependenceIterator.h.

Referenced by getDestination(), isAuxiliary(), isDefUse(), and isInvalid().

◆ auxSrc

Operation* circt::scheduling::detail::Dependence::auxSrc
private

Definition at line 76 of file DependenceIterator.h.

Referenced by getSource(), isAuxiliary(), and isDefUse().

◆ defUse

OpOperand* circt::scheduling::detail::Dependence::defUse

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