*
* This algorithm destoyes the link field of block nodes.
*
- * @returns Maximal depth of loop tree.
- *
* @remark
* One assumes, the Phi nodes in a block with a backedge have backedges
* at the same positions as the block. This is not the case, as
* edges, the cycle is removed. The second Phi node does not get a
* backedge!
*/
-FIRM_API int construct_backedges(ir_graph *irg);
+FIRM_API void construct_backedges(ir_graph *irg);
/**
* Construct Intra-procedural control flow loop tree for a IR-graph.
* This algorithm destroyes the link field of block nodes.
*
* @param irg the graph
- *
- * @returns Maximal depth of loop tree.
*/
-FIRM_API int construct_cf_backedges(ir_graph *irg);
+FIRM_API void construct_cf_backedges(ir_graph *irg);
/**
* Computes Intra-procedural control flow loop tree on demand.
/** Counter to generate depth first numbering of visited nodes. */
static int current_dfn = 1;
-static unsigned max_loop_depth = 0;
-
/**********************************************************************/
/* Node attributes needed for the construction. **/
/**********************************************************************/
ir_loop *father = current_loop;
ir_loop *son = alloc_loop(father, get_irg_obstack(outermost_ir_graph));
- if (son->depth > max_loop_depth) max_loop_depth = son->depth;
current_loop = son;
return father;
}
}
}
-int construct_cf_backedges(ir_graph *irg)
+void construct_cf_backedges(ir_graph *irg)
{
ir_loop *head_rem;
ir_node *end = get_irg_end(irg);
struct obstack temp;
int i;
- max_loop_depth = 0;
-
outermost_ir_graph = irg;
obstack_init(&temp);
mature_loops(current_loop, get_irg_obstack(irg));
set_irg_loop(irg, current_loop);
add_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
-
- return max_loop_depth;
}
void assure_loopinfo(ir_graph *irg)
/** Counter to generate depth first numbering of visited nodes. */
static int current_dfn = 1;
-static unsigned max_loop_depth = 0;
-
/**********************************************************************/
/* Node attributes needed for the construction. **/
/**********************************************************************/
ir_loop *father = current_loop;
ir_loop *son = alloc_loop(father, get_irg_obstack(outermost_ir_graph));
- if (son->depth > max_loop_depth) max_loop_depth = son->depth;
current_loop = son;
return father;
}
}
}
-int construct_backedges(ir_graph *irg)
+void construct_backedges(ir_graph *irg)
{
ir_graph *rem = current_ir_graph;
ir_loop *head_rem;
struct obstack temp;
- max_loop_depth = 0;
current_ir_graph = irg;
outermost_ir_graph = irg;
add_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
assert(get_irg_loop(irg)->kind == k_ir_loop);
current_ir_graph = rem;
- return max_loop_depth;
}
static void reset_backedges(ir_node *n)