MLIR
20.0.0git
|
#include "mlir/Dialect/Affine/Analysis/Utils.h"
Classes | |
struct | Edge |
struct | Node |
Public Member Functions | |
MemRefDependenceGraph (Block &block) | |
bool | init () |
Node * | getNode (unsigned id) |
Node * | getForOpNode (AffineForOp forOp) |
unsigned | addNode (Operation *op) |
void | removeNode (unsigned id) |
bool | writesToLiveInOrEscapingMemrefs (unsigned id) |
bool | hasEdge (unsigned srcId, unsigned dstId, Value value=nullptr) |
void | addEdge (unsigned srcId, unsigned dstId, Value value) |
void | removeEdge (unsigned srcId, unsigned dstId, Value value) |
bool | hasDependencePath (unsigned srcId, unsigned dstId) |
unsigned | getIncomingMemRefAccesses (unsigned id, Value memref) |
unsigned | getOutEdgeCount (unsigned id, Value memref=nullptr) |
void | gatherDefiningNodes (unsigned id, DenseSet< unsigned > &definingNodes) |
Return all nodes which define SSA values used in node 'id'. More... | |
Operation * | getFusedLoopNestInsertionPoint (unsigned srcId, unsigned dstId) |
void | updateEdges (unsigned srcId, unsigned dstId, const DenseSet< Value > &privateMemRefs, bool removeSrcId) |
void | updateEdges (unsigned sibId, unsigned dstId) |
void | addToNode (unsigned id, const SmallVectorImpl< Operation * > &loads, const SmallVectorImpl< Operation * > &stores) |
void | clearNodeLoadAndStores (unsigned id) |
void | forEachMemRefInputEdge (unsigned id, const std::function< void(Edge)> &callback) |
void | forEachMemRefOutputEdge (unsigned id, const std::function< void(Edge)> &callback) |
void | forEachMemRefEdge (ArrayRef< Edge > edges, const std::function< void(Edge)> &callback) |
void | print (raw_ostream &os) const |
void | dump () const |
Public Attributes | |
DenseMap< unsigned, Node > | nodes |
DenseMap< unsigned, SmallVector< Edge, 2 > > | inEdges |
DenseMap< unsigned, SmallVector< Edge, 2 > > | outEdges |
DenseMap< Value, unsigned > | memrefEdgeCount |
unsigned | nextNodeId = 0 |
Block & | block |
The block for which this graph is created to perform fusion. More... | |
|
inline |
void MemRefDependenceGraph::addEdge | ( | unsigned | srcId, |
unsigned | dstId, | ||
Value | value | ||
) |
Definition at line 316 of file Utils.cpp.
References mlir::Value::getType().
unsigned MemRefDependenceGraph::addNode | ( | Operation * | op | ) |
Definition at line 251 of file Utils.cpp.
References mlir::affine::MemRefDependenceGraph::Node::id.
void MemRefDependenceGraph::addToNode | ( | unsigned | id, |
const SmallVectorImpl< Operation * > & | loads, | ||
const SmallVectorImpl< Operation * > & | stores | ||
) |
Definition at line 568 of file Utils.cpp.
References mlir::affine::MemRefDependenceGraph::Node::loads, and mlir::affine::MemRefDependenceGraph::Node::stores.
void MemRefDependenceGraph::clearNodeLoadAndStores | ( | unsigned | id | ) |
Definition at line 576 of file Utils.cpp.
References mlir::affine::MemRefDependenceGraph::Node::loads, and mlir::affine::MemRefDependenceGraph::Node::stores.
|
inline |
void MemRefDependenceGraph::forEachMemRefInputEdge | ( | unsigned | id, |
const std::function< void(Edge)> & | callback | ||
) |
void MemRefDependenceGraph::forEachMemRefOutputEdge | ( | unsigned | id, |
const std::function< void(Edge)> & | callback | ||
) |
void MemRefDependenceGraph::gatherDefiningNodes | ( | unsigned | id, |
DenseSet< unsigned > & | definingNodes | ||
) |
Node * MemRefDependenceGraph::getForOpNode | ( | AffineForOp | forOp | ) |
Operation * MemRefDependenceGraph::getFusedLoopNestInsertionPoint | ( | unsigned | srcId, |
unsigned | dstId | ||
) |
unsigned MemRefDependenceGraph::getIncomingMemRefAccesses | ( | unsigned | id, |
Value | memref | ||
) |
Definition at line 388 of file Utils.cpp.
References mlir::affine::MemRefDependenceGraph::Node::getStoreOpCount().
Node * MemRefDependenceGraph::getNode | ( | unsigned | id | ) |
Definition at line 236 of file Utils.cpp.
Referenced by canRemoveSrcNodeAfterFusion(), gatherEscapingMemrefs(), gatherProducerConsumerMemrefs(), and getProducerCandidates().
unsigned MemRefDependenceGraph::getOutEdgeCount | ( | unsigned | id, |
Value | memref = nullptr |
||
) |
bool MemRefDependenceGraph::hasDependencePath | ( | unsigned | srcId, |
unsigned | dstId | ||
) |
Definition at line 354 of file Utils.cpp.
References mlir::affine::MemRefDependenceGraph::Edge::id, and mlir::Operation::isBeforeInBlock().
bool MemRefDependenceGraph::hasEdge | ( | unsigned | srcId, |
unsigned | dstId, | ||
Value | value = nullptr |
||
) |
Definition at line 301 of file Utils.cpp.
References mlir::affine::MemRefDependenceGraph::Edge::id, and mlir::affine::MemRefDependenceGraph::Edge::value.
bool MemRefDependenceGraph::init | ( | ) |
Definition at line 111 of file Utils.cpp.
References mlir::affine::LoopNestStateCollector::collect(), mlir::affine::getAffineForIVs(), mlir::Operation::getResults(), mlir::Operation::getUsers(), mlir::affine::LoopNestStateCollector::hasNonAffineRegionOp, mlir::affine::MemRefDependenceGraph::Node::id, mlir::isMemoryEffectFree(), mlir::affine::LoopNestStateCollector::loadOpInsts, mlir::affine::MemRefDependenceGraph::Node::loads, mlir::affine::MemRefDependenceGraph::Node::op, mlir::affine::LoopNestStateCollector::storeOpInsts, and mlir::affine::MemRefDependenceGraph::Node::stores.
void MemRefDependenceGraph::print | ( | raw_ostream & | os | ) | const |
void MemRefDependenceGraph::removeEdge | ( | unsigned | srcId, |
unsigned | dstId, | ||
Value | value | ||
) |
Definition at line 327 of file Utils.cpp.
References mlir::Value::getType().
void MemRefDependenceGraph::updateEdges | ( | unsigned | sibId, |
unsigned | dstId | ||
) |
bool MemRefDependenceGraph::writesToLiveInOrEscapingMemrefs | ( | unsigned | id | ) |
Definition at line 281 of file Utils.cpp.
References mlir::affine::MemRefDependenceGraph::Node::stores.
Block& mlir::affine::MemRefDependenceGraph::block |
The block for which this graph is created to perform fusion.
Definition at line 211 of file Utils.h.
Referenced by gatherEscapingMemrefs().
DenseMap<unsigned, SmallVector<Edge, 2> > mlir::affine::MemRefDependenceGraph::inEdges |
Definition at line 110 of file Utils.h.
Referenced by getProducerCandidates().
unsigned mlir::affine::MemRefDependenceGraph::nextNodeId = 0 |
DenseMap<unsigned, SmallVector<Edge, 2> > mlir::affine::MemRefDependenceGraph::outEdges |
Definition at line 112 of file Utils.h.
Referenced by canRemoveSrcNodeAfterFusion().