14 #ifndef CIRCT_SCHEDULING_DEPENDENCEITERATOR_H
15 #define CIRCT_SCHEDULING_DEPENDENCEITERATOR_H
19 #include "llvm/ADT/DenseMapInfo.h"
20 #include "llvm/ADT/SetVector.h"
21 #include "llvm/ADT/iterator.h"
26 namespace scheduling {
39 std::tuple<Operation *, Operation *, std::optional<unsigned>,
40 std::optional<unsigned>>;
88 :
public llvm::iterator_facade_base<DependenceIterator,
89 std::forward_iterator_tag, Dependence> {
Problem::Dependence Dependence
This class models the most basic scheduling problem.
An iterator to transparently surface an operation's def-use dependences from the SSA subgraph (induce...
DependenceIterator & operator++()
bool operator==(const DependenceIterator &other) const
void findNextDependence()
llvm::SmallSetVector< Operation *, 4 > * auxPreds
DependenceIterator(Problem &problem, Operation *op, bool end=false)
Construct an iterator over the op's def-use dependences (i.e.
const Dependence & operator*() const
A wrapper class to uniformly handle def-use and auxiliary dependence edges.
bool isInvalid() const
Return true if this is an invalid dependence.
std::tuple< Operation *, Operation *, std::optional< unsigned >, std::optional< unsigned > > TupleRepr
The "expanded" representation of a dependence, intended as the key for comparisons and hashing.
bool operator==(const Dependence &other) const
std::optional< unsigned > getDestinationIndex() const
Return the destination operation's operand number, if applicable.
std::optional< unsigned > getSourceIndex() const
Return the source operation's result number, if applicable.
Operation * getDestination() const
Return the destination of the dependence.
bool isAuxiliary() const
Return true if this is a valid auxiliary dependence.
TupleRepr getAsTuple() const
Return the tuple representation of this dependence.
Dependence(std::pair< Operation *, Operation * > auxDep)
Wrap an auxiliary dependence, identified by the pair of its endpoints.
bool isDefUse() const
Return true if this is a valid def-use dependence.
Operation * getSource() const
Return the source of the dependence.
Dependence()
Construct an invalid dependence.
Dependence(OpOperand *defUseDep)
Wrap a def-use dependence, which is uniquely identified in the SSA graph by an OpOperand.
Dependence(Operation *from, Operation *to)
Wrap an auxiliary dependence between from and to.
Direction get(bool isOutput)
Returns an output direction if isOutput is true, otherwise returns an input direction.
llvm::hash_code hash_value(const BundledChannel channel)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
static unsigned getHashValue(const Dependence &val)
static Dependence getTombstoneKey()
static bool isEqual(const Dependence &lhs, const Dependence &rhs)
static Dependence getEmptyKey()