My Project
|
A slice of a CAG (which may be the whole graph). More...
#include <ConstraintAnalysisGraph.h>
Public Types | |
using | node_vector = std::vector< CAGNode * > |
using | iterator = node_vector::iterator |
using | const_iterator = node_vector::const_iterator |
Public Member Functions | |
CAGSlice (SolverContext &context) | |
~CAGSlice () | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
CAGOperandAnchor * | getOperandAnchor (Operation *op, unsigned operandIdx) |
Gets an operand anchor node. More... | |
CAGResultAnchor * | getResultAnchor (Operation *op, unsigned resultIdx) |
Gets a result anchor node. More... | |
template<typename T , typename... Args> | |
T * | addUniqueConstraint (ArrayRef< CAGAnchorNode *> anchors, Args... args) |
template<typename T , typename... Args> | |
T * | addUnidirectionalConstraint (CAGAnchorNode *fromAnchor, ArrayRef< CAGAnchorNode *> toAnchors, Args... args) |
Adds a unidirectional constraint from a node to an array of target nodes. More... | |
template<typename T > | |
T * | addClusteredConstraint (ArrayRef< CAGAnchorNode *> anchors) |
void | enumerateImpliedConnections (std::function< void(CAGAnchorNode *from, CAGAnchorNode *to)> callback) |
unsigned | propagate (const TargetConfiguration &config) |
A slice of a CAG (which may be the whole graph).
using mlir::quantizer::CAGSlice::const_iterator = node_vector::const_iterator |
using mlir::quantizer::CAGSlice::iterator = node_vector::iterator |
using mlir::quantizer::CAGSlice::node_vector = std::vector<CAGNode *> |
CAGSlice::CAGSlice | ( | SolverContext & | context | ) |
CAGSlice::~CAGSlice | ( | ) |
|
inline |
|
inline |
Adds a unidirectional constraint from a node to an array of target nodes.
|
inline |
Adds a relation constraint with incoming 'from' anchors and outgoing 'to' anchors.
|
inline |
|
inline |
|
inline |
|
inline |
void CAGSlice::enumerateImpliedConnections | ( | std::function< void(CAGAnchorNode *from, CAGAnchorNode *to)> | callback | ) |
Enumerates all implied connections in the slice. An implied connection is any two nodes that physically refer to the same value in the IR, such as result->operand. Typically this will be modeled with some kind of strong or weak identity constraint such that types propagate. This is usually called when the slice has been fully constructed in order to add final constraints. It is legal for the callback to modify the graph by adding constraints.
CAGOperandAnchor * CAGSlice::getOperandAnchor | ( | Operation * | op, |
unsigned | operandIdx | ||
) |
Gets an operand anchor node.
CAGResultAnchor * CAGSlice::getResultAnchor | ( | Operation * | op, |
unsigned | resultIdx | ||
) |
Gets a result anchor node.
unsigned CAGSlice::propagate | ( | const TargetConfiguration & | config | ) |
Performs one round of propagation, returning the number of nodes propagates. If returns > 0, then additional propagate() rounds are required.