* @file
* @brief Dead node elimination
* @author Michael Beck, Goetz Lindenmaier
- * @version $Id: opt_inline.c 27265 2010-03-07 15:13:00Z matze $
*
* Strictly speaking dead node elimination is unnecessary in firm - everthying
* which is not used can't be found by any walker.
static void copy_node_dce(ir_node *node, void *env)
{
ir_node *new_node = exact_copy(node);
- ir_graph *irg = get_irn_irg(new_node);
(void) env;
/* preserve the node numbers for easier debugging */
new_node->node_nr = node->node_nr;
set_irn_link(node, new_node);
- hook_dead_node_elim_subst(irg, node, new_node);
}
/**
*/
static void copy_graph_env(ir_graph *irg)
{
+ ir_node *anchor = irg->anchor;
ir_node *new_anchor;
/* copy nodes */
- irg_walk_anchors(irg, copy_node_dce, rewire_inputs, NULL);
+ irg_walk_in_or_dep(anchor, copy_node_dce, rewire_inputs, NULL);
/* fix the anchor */
- new_anchor = (ir_node*)get_irn_link(irg->anchor);
+ new_anchor = (ir_node*)get_irn_link(anchor);
assert(new_anchor != NULL);
irg->anchor = new_anchor;
}
/* inform statistics that we started a dead-node elimination run */
hook_dead_node_elim(irg, 1);
- assert(get_irg_phase_state(irg) != phase_building);
-
/* Handle graph state */
free_callee_info(irg);
free_irg_outs(irg);
free_trouts();
free_loop_information(irg);
free_vrp_data(irg);
- clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
+ clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
/* A quiet place, where the old obstack can rest in peace,
until it will be cremated. */