14 #ifndef LLVM_ANALYSIS_DEPENDENCE_GRAPH_BUILDER_H 15 #define LLVM_ANALYSIS_DEPENDENCE_GRAPH_BUILDER_H 34 using EdgeType =
typename GraphType::EdgeType;
135 "No ordinal computed for this instruction.");
142 "No ordinal computed for this node.");
178 #endif // LLVM_ANALYSIS_DEPENDENCE_GRAPH_BUILDER_H
This class represents lattice values for constants.
virtual EdgeType & createDefUseEdge(NodeType &Src, NodeType &Tgt)=0
Create a def-use edge going from Src to Tgt.
DependenceInfo - This class is the main dependence-analysis driver.
virtual const NodeListType & getNodesInPiBlock(const NodeType &N)=0
Given a pi-block node, return a vector of all the nodes contained within it.
const BasicBlockListType & BBList
The list of basic blocks to consider when building the graph.
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
AbstractDependenceGraphBuilder(GraphType &G, DependenceInfo &D, const BasicBlockListType &BBs)
void createFineGrainedNodes()
Create fine grained nodes.
virtual EdgeType & createMemoryEdge(NodeType &Src, NodeType &Tgt)=0
Create a memory dependence edge going from Src to Tgt.
virtual EdgeType & createRootedEdge(NodeType &Src, NodeType &Tgt)=0
Create a rooted edge going from Src to Tgt .
virtual void destroyNode(NodeType &N)
Deallocate memory of node N.
virtual void destroyEdge(EdgeType &E)
Deallocate memory of edge E.
NodeToOrdinalMap NodeOrdinalMap
A mapping from nodes to an ordinal number.
void sortNodesTopologically()
Topologically sort the graph nodes.
iterator find(const_arg_type_t< KeyT > Val)
size_t getOrdinal(Instruction &I)
Given an instruction I return its associated ordinal number.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
EquivalenceClasses - This represents a collection of equivalence classes and supports three efficient...
void createDefUseEdges()
Analyze the def-use chains and create edges from the nodes containing definitions to the nodes contai...
virtual bool shouldCreatePiBlocks() const
Return true if creation of pi-blocks are supported and desired, and false otherwise.
void populate()
The main entry to the graph construction algorithm.
void computeInstructionOrdinals()
Compute ordinal numbers for each instruction and store them in a map for future look up...
InstToOrdinalMap InstOrdinalMap
A mapping from each instruction to an ordinal number.
void createPiBlocks()
Apply graph abstraction to groups of nodes that belong to a strongly connected component of the graph...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
virtual ~AbstractDependenceGraphBuilder()
void createMemoryDependencyEdges()
Analyze data dependencies that exist between memory loads or stores, in the graph nodes and create ed...
This abstract builder class defines a set of high-level steps for creating DDG-like graphs...
virtual NodeType & createPiBlock(const NodeListType &L)=0
Create a pi-block node in the graph representing a group of nodes in an SCC of the graph...
InstToNodeMap IMap
A mapping from instructions to the corresponding nodes in the graph.
DependenceInfo & DI
Dependence information used to create memory dependence edges in the graph.
size_t getOrdinal(NodeType &N)
Given a node N return its associated ordinal number.
virtual NodeType & createFineGrainedNode(Instruction &I)=0
Create an atomic node in the graph given a single instruction.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
virtual NodeType & createRootNode()=0
Create the root node of the graph.
GraphType & Graph
Reference to the graph that gets built by a concrete implementation of this builder.
void createAndConnectRootNode()
Create a root node and add edges such that each node in the graph is reachable from the root...