52 #include <boost/graph/adjacency_list.hpp> 53 #include <boost/graph/filtered_graph.hpp> 54 #include <boost/tuple/tuple.hpp> 58 #pragma GCC diagnostic push 59 #pragma GCC diagnostic error "-Weffc++" 65 is_innermost_loop(
false),
73 alternative_entries(),
74 loop_id(curr_unused_irreducible_id--),
75 exit_landing_association(),
126 loop_id = bb_node_info->block->number;
168 return exits.begin();
191 for(lp_iter =
landing_pads.begin(); lp_iter != lp_end; ++lp_iter)
201 graph::out_edge_iterator e_out_iter, e_out_iter_end;
203 for(boost::tie(e_out_iter, e_out_iter_end) = boost::out_edges(lp, *
g); e_out_iter != e_out_iter_end; ++e_out_iter)
214 if(test_candidate != candidate)
220 graph::out_edge_iterator e_iter, e_iter_end;
222 for(boost::tie(e_iter, e_iter_end) = boost::out_edges(candidate, *
g); e_iter != e_iter_end; ++e_iter)
258 source_end = belonging.end();
259 for(source = belonging.begin(); source != source_end; ++source)
262 graph::out_edge_iterator e_out_iter, e_out_iter_end;
263 for(boost::tie(e_out_iter, e_out_iter_end) = boost::out_edges(block, *
g); e_out_iter != e_out_iter_end;
268 if(belonging.find(target) == belonging.end())
271 exits.push_back(block);
296 for(child =
children.begin(); child != child_end; ++child)
298 (*child)->get_recursively_bb(ret);
304 THROW_ASSERT(boost::num_vertices(*op_graph),
"Operation graph not yet built");
309 for(it = bb_vertices.begin(); it != it_end; ++it)
312 ret.insert(bb_node_info->statements_list.begin(), bb_node_info->statements_list.end());
326 #pragma GCC diagnostic pop Loop(const BBGraphRef g)
Constructor for empty loop (used for irreducible)
std::list< vertex > exits
exit blocks for this loop
void SetParent(LoopRef parent)
Sets parent for this loop.
vertex body_start
body start basic block (at the moment defined only for SIMPLE_LOOP & WHILE_LOOP)
bool close_interval
flag for induction variable close interval defined when loop_type is COUNTABLE_LOOP ...
long long instruction_size
loop instruction footprint
bool is_innermost_loop
tells if there aren't loop nested in this
std::map< vertex, CustomUnorderedSet< vertex > > exit_landing_association
Map storing the association between an exit basic block and the corresponding landing pads...
void AddChild(LoopRef child)
Adds a child loop.
long long footprint_size
loop memory footprint
refcount< Loop > parent_loop
Parent loop.
tree_nodeRef upper_bound_tn
Final value of induction variable.
const LoopRef Parent() const
returns the parent loop
vertex primary_landing_pad() const
integer_cst_t lower_bound
Initial value of induction variable defined when loop_type is COUNTABLE_LOOP.
exceptions managed by PandA
void add_block(vertex block)
adds a block to this loop
const BBGraphRef g
The basic block control flow graph.
const CustomUnorderedSet< vertex > & get_blocks() const
returns the blocks
CustomOrderedSet< LoopConstRef > children
Child loops.
std::list< vertex >::const_iterator exit_block_iter_end() const
Data structure describing a basic block at tree level.
CustomOrderedSet< vertex > alternative_entries
in case the loop is irreducible the loop has multiple entries while for reducible loops the entry is ...
std::list< vertex >::const_iterator exit_block_iter_begin() const
A set of operation vertices.
#define UNKNOWN_LOOP
unknown loop
const CustomUnorderedSet< vertex > GetLandingPadBlocks() const
Return the landing pads of the loops.
tree_nodeRef init
value of the initialization of the induction variable
size_t num_blocks() const
returns the number of basic blocks belonging to this loop
CustomUnorderedSet< vertex > blocks
Blocks which belong to this loop.
OpVertexSet GetRecursivelyOps(const OpGraphConstRef op_graph) const
Returns the operation which belongs to this loop or to a nested loop.
unsigned int inc_id
The node id containing the increment statement.
unsigned int loop_id
the id of the loop
const std::map< vertex, CustomUnorderedSet< vertex > > & get_exit_landing_association() const
Returns the map exit_landing_association.
integer_cst_t upper_bound
Final value of induction variable defined when loop_type is COUNTABLE_LOOP.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
CustomUnorderedSet< vertex > landing_pads
landing_pads for this loop
tree_nodeRef increment_tn
Increment of induction variable.
This struct specifies the block node.
unsigned int init_gimple_id
The index of the gimple tree node containing the initialization of the induction variable; right oper...
void init(int bucket[BUCKETSIZE])
unsigned int GetId() const
returns the loop id
void ComputeLandingPadExits()
compute landing pad exits
size_t num_landing_pads() const
bool is_innermost() const
tells if the loop is innermost
vertex GetHeader() const
returns loop header
CustomOrderedSet< std::pair< vertex, vertex > > sp_back_edges
set of vertex pairs describing a spanning tree back edge for the loop
Class specification of the basic_block structure.
const BBNodeInfoConstRef CGetBBNodeInfo(const vertex node) const
Return the info associated with a basic block.
Data structures used in operations graph.
refcount< Loop > LoopRef
refcount definition of the class
void get_recursively_bb(CustomUnorderedSet< vertex > &ret) const
Returns the basic blocks which belong to this loop and to loop nested in this loop.
static unsigned int curr_unused_irreducible_id
used to label irreducible loops
integer_cst_t increment
Increment of induction variable.
bool IsReducible() const
tells if the loop is reducible
vertex primary_landing_pad_block
???
const CustomOrderedSet< LoopConstRef > & GetChildren() const
Returns the children of this loop in the loop forest.
unsigned int depth
Nesting depth of this loop.
#define NULL_VERTEX
null vertex definition
unsigned int main_iv
the main induction variable of countable loop;
A brief description of the C++ Header File.
vertex header_block
the header of the loop
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...