69 unsigned int _function_id,
const DesignFlowManagerConstRef _design_flow_manager)
81 switch(relationship_type)
85 relationships.insert(std::make_pair(OP_CONTROL_DEPENDENCE_COMPUTATION,
SAME_FUNCTION));
86 relationships.insert(std::make_pair(OP_FEEDBACK_EDGES_IDENTIFICATION,
SAME_FUNCTION));
87 relationships.insert(std::make_pair(OP_REACHABILITY_COMPUTATION,
SAME_FUNCTION));
88 relationships.insert(std::make_pair(SCALAR_SSA_DATA_FLOW_ANALYSIS,
SAME_FUNCTION));
89 relationships.insert(std::make_pair(VIRTUAL_AGGREGATE_DATA_FLOW_ANALYSIS,
SAME_FUNCTION));
102 return relationships;
110 if(boost::num_vertices(*flg) != 0)
113 for(boost::tie(edge, edge_end) =
boost::edges(*flg); edge != edge_end; edge++)
136 const std::list<LoopConstRef>& loops =
function_behavior->CGetLoops()->GetList();
139 std::list<LoopConstRef>::const_iterator loop, loop_end = loops.end();
140 for(loop = loops.begin(); loop != loop_end; ++loop)
143 if(!(*loop)->IsReducible())
151 for(it = loop_bb.begin(); it != it_end; ++it)
155 const std::list<vertex>& statements_list = bb_node_info->statements_list;
156 std::list<vertex>::const_iterator it2, it2_end = statements_list.end();
157 for(it2 = statements_list.begin(); it2 != it2_end; ++it2)
159 if(bb_node_info->block->number != bb_node_info->loop_id)
162 loop_operations[(*loop)->GetId()].insert(*it2);
168 const vertex header = (*loop)->GetHeader();
170 const std::list<vertex>& statements_list = bb_node_info->statements_list;
171 THROW_ASSERT(statements_list.size(),
"Header of a loop " + std::to_string((*loop)->GetId()) +
" is empty");
172 const vertex last_statement = *(statements_list.rbegin());
176 auto it3_end = loop_operations[(*loop)->GetId()].end();
177 for(
auto it3 = loop_operations[(*loop)->GetId()].begin(); it3 != it3_end; ++it3)
180 "Adding flow edge from " +
GET_NAME(fcfg, last_statement) +
" to " +
GET_NAME(fcfg, *it3));
184 const vertex first_statement = *(statements_list.begin());
185 for(
auto it3 = loop_operations[(*loop)->GetId()].begin(); it3 != it3_end; ++it3)
188 "Adding a feedback flow edge from " +
GET_NAME(fcfg, *it3) +
" to " +
195 const std::string function_name =
function_behavior->CGetBehavioralHelper()->get_function_name();
197 if(
parameters->getOption<
bool>(OPT_print_dot))
206 std::deque<vertex> vertices;
207 boost::topological_sort(*flsaodg, std::front_inserter(vertices));
209 catch(
const char* msg)
211 THROW_UNREACHABLE(
"flsaodg graph of function " + function_name +
" is not acyclic");
213 catch(
const std::string& msg)
215 THROW_UNREACHABLE(
"flsaodg graph of function " + function_name +
" is not acyclic");
217 catch(
const std::exception& ex)
219 THROW_UNREACHABLE(
"flsaodg graph of function " + function_name +
" is not acyclic");
223 THROW_UNREACHABLE(
"flsaodg graph of function " + function_name +
" is not acyclic");
#define FLG_SELECTOR
Flow edge selector.
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
File containing functions and utilities to support the printing of debug messagges.
#define PRINT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
Definition of the class representing a generic C application.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
#define GET_NAME(data, vertex_index)
Helper macro returning the name associated with a node.
Analysis step which adds flow edges for scheduling to operation graphs.
DesignFlowStep_Status InternalExec() override
Performs the adding of flow edges to operation graphs.
#define FB_FLG_SELECTOR
Feedback flow edge selector.
Data structure describing a basic block at tree level.
unsigned int bb_version
The version of the basic block intermediate representation on which this step has been applied...
Auxiliary methods for manipulating string.
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
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
~AddOpLoopFlowEdges() override
Destructor.
Basic block control flow graph with feedback.
Target must be reexecuted.
AddOpLoopFlowEdges(const ParameterConstRef _parameters, const application_managerRef AppM, unsigned int function_id, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
#define DEBUG_LEVEL_NONE
no debugging print is performed.
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
Class specification of the basic_block structure.
This file collects some hash functors.
const BBNodeInfoConstRef CGetBBNodeInfo(const vertex node) const
Return the info associated with a basic block.
Data structures used in operations graph.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
irreducible loops are not currently supported
#define THROW_ERROR_CODE(code, str_expr)
helper function used to throw an error with a code error
interface of loops finding algorithm
System dependence + anti-dependence + output dependence graph + flow graph.
this class is used to manage the command-line or XML options.
Control flow graph with feedback.
int debug_level
The debug level.
This class provides methods to build an operations graph.
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.
System dependence + anti-dependence + output dependence graph + flow graph with feedback.
A brief description of the C++ Header File.
const FunctionBehaviorRef function_behavior
The function behavior of the function to be analyzed.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...