MLIR  20.0.0git
Classes | Public Member Functions | Public Attributes | List of all members
mlir::affine::MemRefDependenceGraph Struct Reference

#include "mlir/Dialect/Affine/Analysis/Utils.h"

Classes

struct  Edge
 
struct  Node
 

Public Member Functions

 MemRefDependenceGraph (Block &block)
 
bool init ()
 
NodegetNode (unsigned id)
 
NodegetForOpNode (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...
 
OperationgetFusedLoopNestInsertionPoint (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, Nodenodes
 
DenseMap< unsigned, SmallVector< Edge, 2 > > inEdges
 
DenseMap< unsigned, SmallVector< Edge, 2 > > outEdges
 
DenseMap< Value, unsigned > memrefEdgeCount
 
unsigned nextNodeId = 0
 
Blockblock
 The block for which this graph is created to perform fusion. More...
 

Detailed Description

Definition at line 53 of file Utils.h.

Constructor & Destructor Documentation

◆ MemRefDependenceGraph()

mlir::affine::MemRefDependenceGraph::MemRefDependenceGraph ( Block block)
inline

Definition at line 119 of file Utils.h.

Member Function Documentation

◆ addEdge()

void MemRefDependenceGraph::addEdge ( unsigned  srcId,
unsigned  dstId,
Value  value 
)

Definition at line 316 of file Utils.cpp.

References mlir::Value::getType().

◆ addNode()

unsigned MemRefDependenceGraph::addNode ( Operation op)

Definition at line 251 of file Utils.cpp.

References mlir::affine::MemRefDependenceGraph::Node::id.

◆ addToNode()

void MemRefDependenceGraph::addToNode ( unsigned  id,
const SmallVectorImpl< Operation * > &  loads,
const SmallVectorImpl< Operation * > &  stores 
)

◆ clearNodeLoadAndStores()

void MemRefDependenceGraph::clearNodeLoadAndStores ( unsigned  id)

◆ dump()

void mlir::affine::MemRefDependenceGraph::dump ( ) const
inline

Definition at line 208 of file Utils.h.

References print().

◆ forEachMemRefEdge()

void MemRefDependenceGraph::forEachMemRefEdge ( ArrayRef< Edge edges,
const std::function< void(Edge)> &  callback 
)

Definition at line 600 of file Utils.cpp.

◆ forEachMemRefInputEdge()

void MemRefDependenceGraph::forEachMemRefInputEdge ( unsigned  id,
const std::function< void(Edge)> &  callback 
)

Definition at line 584 of file Utils.cpp.

◆ forEachMemRefOutputEdge()

void MemRefDependenceGraph::forEachMemRefOutputEdge ( unsigned  id,
const std::function< void(Edge)> &  callback 
)

Definition at line 592 of file Utils.cpp.

◆ gatherDefiningNodes()

void MemRefDependenceGraph::gatherDefiningNodes ( unsigned  id,
DenseSet< unsigned > &  definingNodes 
)

Return all nodes which define SSA values used in node 'id'.

Definition at line 414 of file Utils.cpp.

◆ getForOpNode()

Node * MemRefDependenceGraph::getForOpNode ( AffineForOp  forOp)

Definition at line 243 of file Utils.cpp.

◆ getFusedLoopNestInsertionPoint()

Operation * MemRefDependenceGraph::getFusedLoopNestInsertionPoint ( unsigned  srcId,
unsigned  dstId 
)

Definition at line 428 of file Utils.cpp.

◆ getIncomingMemRefAccesses()

unsigned MemRefDependenceGraph::getIncomingMemRefAccesses ( unsigned  id,
Value  memref 
)

◆ getNode()

Node * MemRefDependenceGraph::getNode ( unsigned  id)

◆ getOutEdgeCount()

unsigned MemRefDependenceGraph::getOutEdgeCount ( unsigned  id,
Value  memref = nullptr 
)

Definition at line 404 of file Utils.cpp.

◆ hasDependencePath()

bool MemRefDependenceGraph::hasDependencePath ( unsigned  srcId,
unsigned  dstId 
)

◆ hasEdge()

bool MemRefDependenceGraph::hasEdge ( unsigned  srcId,
unsigned  dstId,
Value  value = nullptr 
)

◆ init()

bool MemRefDependenceGraph::init ( )

◆ print()

void MemRefDependenceGraph::print ( raw_ostream &  os) const

Definition at line 615 of file Utils.cpp.

Referenced by dump().

◆ removeEdge()

void MemRefDependenceGraph::removeEdge ( unsigned  srcId,
unsigned  dstId,
Value  value 
)

Definition at line 327 of file Utils.cpp.

References mlir::Value::getType().

◆ removeNode()

void MemRefDependenceGraph::removeNode ( unsigned  id)

Definition at line 258 of file Utils.cpp.

◆ updateEdges() [1/2]

void MemRefDependenceGraph::updateEdges ( unsigned  sibId,
unsigned  dstId 
)

Definition at line 543 of file Utils.cpp.

◆ updateEdges() [2/2]

void MemRefDependenceGraph::updateEdges ( unsigned  srcId,
unsigned  dstId,
const DenseSet< Value > &  privateMemRefs,
bool  removeSrcId 
)

Definition at line 504 of file Utils.cpp.

◆ writesToLiveInOrEscapingMemrefs()

bool MemRefDependenceGraph::writesToLiveInOrEscapingMemrefs ( unsigned  id)

Definition at line 281 of file Utils.cpp.

References mlir::affine::MemRefDependenceGraph::Node::stores.

Member Data Documentation

◆ block

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().

◆ inEdges

DenseMap<unsigned, SmallVector<Edge, 2> > mlir::affine::MemRefDependenceGraph::inEdges

Definition at line 110 of file Utils.h.

Referenced by getProducerCandidates().

◆ memrefEdgeCount

DenseMap<Value, unsigned> mlir::affine::MemRefDependenceGraph::memrefEdgeCount

Definition at line 115 of file Utils.h.

◆ nextNodeId

unsigned mlir::affine::MemRefDependenceGraph::nextNodeId = 0

Definition at line 117 of file Utils.h.

◆ nodes

DenseMap<unsigned, Node> mlir::affine::MemRefDependenceGraph::nodes

Definition at line 108 of file Utils.h.

◆ outEdges

DenseMap<unsigned, SmallVector<Edge, 2> > mlir::affine::MemRefDependenceGraph::outEdges

Definition at line 112 of file Utils.h.

Referenced by canRemoveSrcNodeAfterFusion().


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