57 unsigned int _function_id,
const DesignFlowManagerConstRef _design_flow_manager)
68 switch(relationship_type)
72 relationships.insert(std::make_pair(BB_FEEDBACK_EDGES_IDENTIFICATION,
SAME_FUNCTION));
73 relationships.insert(std::make_pair(DOM_POST_DOM_COMPUTATION,
SAME_FUNCTION));
74 relationships.insert(std::make_pair(BB_ORDER_COMPUTATION,
SAME_FUNCTION));
95 if(boost::num_vertices(*bb_cdg) != 0)
98 for(boost::tie(edge, edge_end) =
boost::edges(*bb_cdg); edge != edge_end; edge++)
113 std::list<vertex> bb_levels;
114 boost::topological_sort(*bb, std::front_inserter(bb_levels));
115 std::map<vertex, unsigned int> bb_sorted;
117 for(
auto& bb_level : bb_levels)
119 bb_sorted[bb_level] = ++
counter;
122 for(boost::tie(ei, ei_end) =
boost::edges(*bb); ei != ei_end; ++ei)
124 vertex A = boost::source(*ei, *bb);
130 if(bb_sorted[current_node] > bb_sorted[A])
136 auto it_end = labels.end();
137 for(
auto it = labels.begin(); it != it_end; ++it)
154 unsigned int cer_counter = 0;
157 std::map<CustomOrderedSet<std::pair<vertex, CustomOrderedSet<unsigned int>>>,
unsigned int> cdg_to_index;
159 const std::deque<vertex>& topological_sorted_nodes =
function_behavior->get_bb_levels();
160 std::deque<vertex>::const_iterator it, it_end;
161 it_end = topological_sorted_nodes.end();
162 for(it = topological_sorted_nodes.begin(); it != it_end; ++it)
164 unsigned int cer_index = cer_counter;
166 if(boost::in_degree(*it, *cdg_bb) > 0)
171 for(boost::tie(eii, eii_end) = boost::in_edges(*it, *cdg_bb); eii != eii_end; eii++)
176 if(cdg_to_index.find(this_cod) == cdg_to_index.end())
178 cdg_to_index[this_cod] = cer_counter;
183 cer_index = cdg_to_index[this_cod];
185 bb_node_info->cer = cer_index;
189 if(
parameters->getOption<
bool>(OPT_print_dot))
~BBCdgComputation() override
Destructor.
Vertex get_immediate_dominator(Vertex v) const
Return the immediate dominator of a Vertex.
Basic block control flow graph.
BBCdgComputation(const ParameterConstRef Param, const application_managerRef AppM, unsigned int function_id, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
boost::graph_traits< graph >::in_edge_iterator InEdgeIterator
in_edge_iterator definition.
This class provides methods to build a basic blocks graph.
unsigned int bb_version
The version of the basic block intermediate representation on which this step has been applied...
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
DesignFlowStep_Status InternalExec() override
Performs the computation of the CDG representation.
boost::graph_traits< graph >::edge_iterator EdgeIterator
edge_iterator definition.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
const BBEdgeInfoConstRef CGetBBEdgeInfo(const EdgeDescriptor e) const
Returns the info associated with an edge.
Analysis step computing basic block control dependencies.
#define CDG_SELECTOR
Control dependence edge selector.
Target must be reexecuted.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
Basic block control dependence graph.
BBNodeInfoRef GetBBNodeInfo(const vertex node)
Return the info associated with a basic block.
Class specification of the basic_block structure.
This file collects some hash functors.
Data structures used in operations graph.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
this class is used to manage the command-line or XML options.
unsigned counter[N_THREADS]
#define CFG_SELECTOR
Control flow graph edge selector.
const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship > > ComputeFrontendRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Return the set of analyses in relationship with this design step.
A brief description of the C++ Header File.
const FunctionBehaviorRef function_behavior
The function behavior of the function to be analyzed.