{
ir_graph *rem = current_ir_graph;
inline_env_t env;
- call_entry *entry;
current_ir_graph = irg;
/* Handle graph state */
*/
static void append_call_list(inline_irg_env *dst, inline_irg_env *src, int loop_depth)
{
- call_entry *entry, *nentry;
+ call_entry *nentry;
/* Note that the src list points to Call nodes in the inlined graph, but
we need Call nodes in our graph. Luckily the inliner leaves this information
* size are inlined.
*/
void inline_leaf_functions(unsigned maxsize, unsigned leafsize,
- unsigned size, int ignore_runtime)
+ unsigned size, int ignore_runtime)
{
inline_irg_env *env;
ir_graph *irg;
ir_graph *rem;
int did_inline;
wenv_t wenv;
- call_entry *entry, *next;
- const call_entry *centry;
pmap *copied_graphs;
pmap_entry *pm_entry;
assert(get_irg_phase_state(irg) != phase_building);
free_callee_info(irg);
- assure_loopinfo(irg);
+ assure_irg_properties(irg,
+ IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
wenv.x = (inline_irg_env*)get_irg_link(irg);
irg_walk_graph(irg, NULL, collect_calls2, &wenv);
+ confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_ALL);
}
/* -- and now inline. -- */
continue;
}
- calleee = (ir_graph*)pmap_get(copied_graphs, callee);
+ calleee = pmap_get(ir_graph, copied_graphs, callee);
if (calleee != NULL) {
/*
* Remap callee if we have a copy.
callee_env = alloc_inline_irg_env();
set_irg_link(copy, callee_env);
- assure_loopinfo(copy);
+ assure_irg_properties(copy,
+ IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
wenv.x = callee_env;
wenv.ignore_callers = 1;
irg_walk_graph(copy, NULL, collect_calls2, &wenv);
*/
static unsigned calc_method_local_weight(ir_node *arg)
{
- int i, j, k;
+ int j;
unsigned v, weight = 0;
- for (i = get_irn_n_outs(arg) - 1; i >= 0; --i) {
+ for (unsigned i = get_irn_n_outs(arg); i-- > 0; ) {
ir_node *succ = get_irn_out(arg, i);
switch (get_irn_opcode(succ)) {
ir_node *pred = get_Tuple_pred(succ, j);
if (pred == arg) {
/* look for Proj(j) */
- for (k = get_irn_n_outs(succ) - 1; k >= 0; --k) {
+ for (unsigned k = get_irn_n_outs(succ); k-- > 0; ) {
ir_node *succ_succ = get_irn_out(succ, k);
if (is_Proj(succ_succ)) {
if (get_Proj_proj(succ_succ) == j) {
ir_entity *ent = get_irg_entity(irg);
ir_type *mtp;
size_t nparams;
- int i;
long proj_nr;
ir_node *irg_args, *arg;
assure_irg_outs(irg);
irg_args = get_irg_args(irg);
- for (i = get_irn_n_outs(irg_args) - 1; i >= 0; --i) {
+ for (unsigned i = get_irn_n_outs(irg_args); i-- > 0; ) {
arg = get_irn_out(irg_args, i);
proj_nr = get_Proj_proj(arg);
env->local_weights[proj_nr] = calc_method_local_weight(arg);
{
int phiproj_computed = 0;
inline_irg_env *env = (inline_irg_env*)get_irg_link(irg);
- call_entry *curr_call;
wenv_t wenv;
pqueue_t *pqueue;
irg_inline_property prop = get_irg_inline_property(callee);
ir_graph *calleee;
int loop_depth;
- const call_entry *centry;
if ((prop < irg_inline_forced) && env->n_nodes + callee_env->n_nodes > maxsize) {
DB((dbg, LEVEL_2, "%+F: too big (%d) + %+F (%d)\n", irg,
continue;
}
- calleee = (ir_graph*)pmap_get(copied_graphs, callee);
+ calleee = pmap_get(ir_graph, copied_graphs, callee);
if (calleee != NULL) {
int benefice = curr_call->benefice;
/*
callee_env = alloc_inline_irg_env();
set_irg_link(copy, callee_env);
- assure_loopinfo(copy);
+ assure_irg_properties(copy, IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
memset(&wenv, 0, sizeof(wenv));
wenv.x = callee_env;
wenv.ignore_callers = 1;