* Note that the new dominance code correctly handles
* the End block, i.e. it is always reachable from Start
*/
- set_Block_dead(block);
+ ir_graph *irg = get_irn_irg(block);
+ exchange(block, get_irg_bad(irg));
}
}
ir_graph *rem = current_ir_graph;
current_ir_graph = irg;
- if (get_irg_dom_state(irg) == dom_consistent)
- irg_block_walk_graph(irg, NULL, kill_dead_blocks, NULL);
-
do_local_optimize(get_irg_end(irg));
current_ir_graph = rem;
/**
* Data flow optimization walker.
- * Optimizes all nodes and enqueue it's users
+ * Optimizes all nodes and enqueue its users
* if done.
*/
static void opt_walker(ir_node *n, void *env)
{
- pdeq *waitq = env;
+ pdeq *waitq = (pdeq*)env;
ir_node *optimized;
optimized = optimize_in_place_2(n);
if (get_opt_global_cse())
set_irg_pinned(irg, op_pin_state_floats);
+ set_irg_state(irg, IR_GRAPH_STATE_BAD_BLOCK);
/* Clean the value_table in irg for the CSE. */
new_identities(irg);
/* finish the wait queue */
while (! pdeq_empty(waitq)) {
- ir_node *n = pdeq_getl(waitq);
+ ir_node *n = (ir_node*)pdeq_getl(waitq);
if (! is_Bad(n))
opt_walker(n, waitq);
}
end = get_irg_end(irg);
remove_End_Bads_and_doublets(end);
+ clear_irg_state(irg, IR_GRAPH_STATE_BAD_BLOCK);
+
current_ir_graph = rem;
return changed;
}