in array contained Bads. Now it's possible.
We don't call optimize_in_place as it requires
that the fields in ir_graph are set properly. */
- if ((get_opt_control_flow_straightening()) &&
- (get_Block_n_cfgpreds(nn) == 1) &&
- is_Jmp(get_Block_cfgpred(nn, 0))) {
+ if (!has_Block_label(nn) &&
+ get_opt_control_flow_straightening() &&
+ get_Block_n_cfgpreds(nn) == 1 &&
+ is_Jmp(get_Block_cfgpred(nn, 0))) {
ir_node *old = get_nodes_block(get_Block_cfgpred(nn, 0));
if (nn == old) {
/* Jmp jumps into the block it is in -- deal self cycle. */
/* -- Replicate local entities of the called_graph -- */
/* copy the entities. */
+ irp_reserve_resources(irp, IR_RESOURCE_ENTITY_LINK);
called_frame = get_irg_frame_type(called_graph);
curr_frame = get_irg_frame_type(irg);
for (i = 0, n = get_class_n_members(called_frame); i < n; ++i) {
irg_walk(get_irg_end(called_graph), copy_node_inline, copy_preds_inline,
get_irg_frame_type(called_graph));
+ irp_free_resources(irp, IR_RESOURCE_ENTITY_LINK);
+
/* Repair called_graph */
set_irg_visited(called_graph, get_irg_visited(irg));
set_irg_block_visited(called_graph, get_irg_block_visited(irg));
}
}
if (n_exc > 0) {
- new_Block(n_exc, cf_pred); /* watch it: current_block is changed! */
+ ir_node *block = new_Block(n_exc, cf_pred);
+ set_cur_block(block);
+
set_Tuple_pred(call, pn_Call_X_except, new_Jmp());
/* The Phi for the memories with the exception objects */
n_exc = 0;
if (! list_empty(&env.calls)) {
/* There are calls to inline */
+ ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
collect_phiprojs(irg);
list_for_each_entry(call_entry, entry, &env.calls, list) {
inline_method(entry->call, callee);
}
}
+ ir_free_resources(irg, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
}
obstack_free(&env.obst, NULL);
current_ir_graph = rem;
current_ir_graph = get_irp_irg(i);
env = get_irg_link(current_ir_graph);
+ ir_reserve_resources(current_ir_graph, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
list_for_each_entry_safe(call_entry, entry, next, &env->calls, list) {
ir_graph *callee;
irg_inline_property prop;
}
}
}
+ ir_free_resources(current_ir_graph, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
}
} while (did_inline);
current_ir_graph = get_irp_irg(i);
env = get_irg_link(current_ir_graph);
+ ir_reserve_resources(current_ir_graph, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
+
/* note that the list of possible calls is updated during the process */
list_for_each_entry_safe(call_entry, entry, next, &env->calls, list) {
irg_inline_property prop;
inline_irg_env *callee_env;
ir_graph *copy;
+ ir_free_resources(current_ir_graph, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
+
/*
* No copy yet, create one.
* Note that recursive methods are never leaves, so it is sufficient
/* create_irg_copy() destroys the Proj links, recompute them */
phiproj_computed = 0;
+ ir_reserve_resources(current_ir_graph, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
+
/* allocate new environment */
callee_env = alloc_inline_irg_env();
set_irg_link(copy, callee_env);
}
}
}
+ ir_free_resources(current_ir_graph, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
}
for (i = 0; i < n_irgs; ++i) {
}
current_ir_graph = irg;
+ ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
/* put irgs into the pqueue */
pqueue = new_pqueue();
if (benefice < inline_threshold)
continue;
+ ir_free_resources(irg, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
+
/*
* No copy yet, create one.
* Note that recursive methods are never leaves, so it is
/* create_irg_copy() destroys the Proj links, recompute them */
phiproj_computed = 0;
+ ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
+
/* allocate a new environment */
callee_env = alloc_inline_irg_env();
set_irg_link(copy, callee_env);
env->n_nodes += callee_env->n_nodes;
--callee_env->n_callers;
}
-
+ ir_free_resources(irg, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
del_pqueue(pqueue);
}