Go to the documentation of this file.
34 #ifndef TTA_PROGRAM_DEPENDENCE_GRAPH_HH
35 #define TTA_PROGRAM_DEPENDENCE_GRAPH_HH
37 #include <boost/graph/filtered_graph.hpp>
52 public BoostGraph<ProgramDependenceNode, ProgramDependenceEdge> {
79 typedef std::map<const ControlDependenceNode*, std::vector<Node*> >
83 template <
typename GraphType>
87 template <
typename Edge>
89 return graph_[e]->isControlDependence()
90 ||
graph_[e]->isArtificialControlDependence();
96 typedef boost::filtered_graph<Graph, CDGFilter<Graph> >
FilteredCDG;
98 typedef boost::graph_traits<FilteredCDG>::in_edge_iterator
100 typedef boost::graph_traits<FilteredCDG>::out_edge_iterator
102 typedef boost::graph_traits<FilteredCDG>::vertex_descriptor
104 typedef std::pair<FilteredInEdgeIter, FilteredInEdgeIter>
106 typedef std::pair<FilteredOutEdgeIter, FilteredOutEdgeIter>
110 typedef boost::associative_property_map<PDGOrderMap>
PDGOrder;
113 typedef boost::associative_property_map<DescriptorMap>
Descriptors;
115 typedef std::map <NodeDescriptor, boost::default_color_type >
ColorMap;
116 typedef boost::associative_property_map<ColorMap>
Color;
119 template <
typename NodeSetType,
typename GraphType>
124 template <
typename Node>
135 template <
typename GraphType>
139 template <
typename Edge>
141 return !(
graph_[e]->isLoopCloseEdge() ||
142 (
graph_[e]->isDataDependence() &&
143 graph_[e]->dataDependenceEdge().isBackEdge()));
147 typedef boost::filtered_graph<
151 template <
typename GraphType>
155 template <
typename Edge>
157 return !(
graph_[e]->isBackEdge());
161 typedef boost::filtered_graph<Graph,BackCFGFilter<Graph> >
237 template <
class Name>
241 template <
class VertexOrEdge>
243 VertexOrEdge& v)
const {
244 out <<
"[" <<
name[v]->dotString() <<
"]";
CompareResult compareSiblings(Node *a, Node *b)
void regionHelper(Node *node, FilteredCDG &filteredCDG, Node::NodesInfo &finalNodesInfo)
void computeEECInfo(const PDGOrderMap &orderMap, FilteredCDG &filteredCDG)
std::pair< FilteredOutEdgeIter, FilteredOutEdgeIter > FilteredOutEdgePair
Node & node(const int index) const
boost::associative_property_map< PDGOrderMap > PDGOrder
std::pair< FilteredInEdgeIter, FilteredInEdgeIter > FilteredInEdgePair
std::map< const BasicBlockNode *, ControlDependenceNode *, BasicBlockNode::Comparator > BBToCD
int detectStrongComponents(PDGOrderMap &components, DescriptorMap &roots, FilteredCDG &filteredCDG)
std::set< ProgramDependenceNode *, typename ProgramDependenceNode ::Comparator > NodeSet
BackFilter(GraphType graph)
bool operator()(const Edge &e) const
int insCount_
Counts new instructions when creating basic blocks.
void processLoopEntry(Node *node, BasicBlockNode *bb)
bool operator()(const Node &n) const
void processRegion(Node *region, FilteredCDG &filteredCDG)
bool operator()(const Edge &e) const
void addLeafEdges(std::vector< BasicBlockNode * > leafs, BasicBlockNode *bb)
Node * ddgEntryNode_
Stored reference to PDG equivalent of DDG ENTRYNODE.
bool operator()(const Edge &e) const
boost::filtered_graph< Graph, BackFilter< Graph >, SubgraphTypeTest< NodeSet, Graph > > Subgraph
const ControlDependenceGraph * cdg_
Stores original control dependence graph.
std::map< NodeDescriptor, boost::default_color_type > ColorMap
Storage for color property used by dfs.
void computeRegionInfo(const PDGOrderMap &orderMap, FilteredCDG &filteredCDG)
void processLoopClose(Node *node)
std::set< ProgramDependenceNode * > NodesInfo
boost::graph_traits< FilteredCDG >::out_edge_iterator FilteredOutEdgeIter
Filter nodes of subgraph only.
void processEntry(BasicBlockNode *firstBB)
Filter control dependence edges only.
ProgramDependenceNode & entryNode() const
virtual ~ProgramDependenceGraph()
const DataDependenceGraph * ddg_
Stores original data dependence graph.
std::map< const ControlDependenceNode *, std::vector< Node * > > MovesInCD
boost::filtered_graph< Graph, CDGFilter< Graph > > FilteredCDG
Type of filtered graph with CD edges only.
boost::associative_property_map< DescriptorMap > Descriptors
ProgramDependenceGraph(ControlDependenceGraph &cdg, DataDependenceGraph &ddg)
std::vector< std::set< Node * > > strongComponents_
stores nodes present in each of the found components
void computeRelations(const PDGOrderMap &orderMap, FilteredCDG &filteredCDG)
boost::adjacency_list< boost::listS, boost::vecS, boost::bidirectionalS, Node *, Edge * > Graph
Internal graph type, providing actual graph-like operations. This type definition relies on bundled p...
SubgraphTypeTest(Node *root, NodeSetType nodes, GraphType graph)
ControlFlowGraph * newCFG_
Newly created control flow graph.
std::map< const MoveNode *, ProgramDependenceNode *, MoveNode::Comparator > MoveNodeToPDGNode
boost::graph_traits< FilteredCDG >::vertex_descriptor FilteredVertexDescriptor
NodeSetType subgraphNodes_
Node * entryNode_
Stores pointer to entry node of the PDG graph.
boost::filtered_graph< Graph, BackCFGFilter< Graph > > CFGSubgraph
std::map< NodeDescriptor, int > PDGOrderMap
Stores data to compute post order relation on CDG and strong components.
CDGFilter(GraphType graph)
void createJump(BasicBlockNode *from, BasicBlockNode *to, TTAProgram::Terminal *guardReg=NULL, ControlFlowEdge::CFGEdgePredicate predicate=ControlFlowEdge::CFLOW_EDGE_NORMAL)
void removeGuardedJump(ControlToProgram &, ProgramDependenceNode &, ControlDependenceNode &)
std::map< const ControlDependenceNode *, ProgramDependenceNode *, ControlDependenceNode::Comparator > ControlToProgram
void operator()(std::ostream &out, const VertexOrEdge &v) const
boost::associative_property_map< ColorMap > Color
void copyRegionEECComponent(ControlToProgram &, BBToCD &, MoveNodeToPDGNode &, MovesInCD &)
boost::graph_traits< FilteredCDG >::in_edge_iterator FilteredInEdgeIter
Few types to work with filtered graph.
void processPredicate(Node *predicate, FilteredCDG &filteredCDG)
TTAProgram::Program * program_
Original Program object, to get instruction reference manager.
std::map< NodeDescriptor, NodeDescriptor > DescriptorMap
Storage for relations between nodes.
BackCFGFilter(GraphType graph)
void moveDDGedges(Node &root, NodeSet &subgraphNodes, FilteredCDG &filteredCDG)