{
ir_graph *irg = get_irn_irg(n);
- /* Handle graph state */
- assert(get_irg_phase_state(irg) != phase_building);
-
if (get_opt_global_cse())
set_irg_pinned(irg, op_pin_state_floats);
- clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
+ clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
/* Clean the value_table in irg for the CSE. */
new_identities(irg);
*/
static void enqueue_users(ir_node *n, pdeq *waitq)
{
- const ir_edge_t *edge;
-
foreach_out_edge(n, edge) {
- ir_node *succ = get_edge_src_irn(edge);
- const ir_edge_t *edge2;
+ ir_node *succ = get_edge_src_irn(edge);
enqueue_node(succ, waitq);
ir_graph *irg = get_irn_irg(block);
ir_node *end = get_irg_end(irg);
- const ir_edge_t *edge;
foreach_block_succ(block, edge) {
- const ir_edge_t *edge2;
ir_node *succ_block = get_edge_src_irn(edge);
enqueue_node(succ_block, waitq);
foreach_out_edge(succ_block, edge2) {
set_irg_pinned(irg, op_pin_state_floats);
/* enable unreachable code elimination */
- assert(!is_irg_state(irg, IR_GRAPH_STATE_OPTIMIZE_UNREACHABLE_CODE));
- set_irg_state(irg, IR_GRAPH_STATE_OPTIMIZE_UNREACHABLE_CODE);
+ assert(!irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_OPTIMIZE_UNREACHABLE_CODE));
+ add_irg_constraints(irg, IR_GRAPH_CONSTRAINT_OPTIMIZE_UNREACHABLE_CODE);
new_identities(irg);
- edges_assure(irg);
+ assure_edges(irg);
assure_doms(irg);
ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
/* disable unreachable code elimination */
- clear_irg_state(irg, IR_GRAPH_STATE_OPTIMIZE_UNREACHABLE_CODE);
- set_irg_state(irg, IR_GRAPH_STATE_NO_UNREACHABLE_CODE);
+ clear_irg_constraints(irg, IR_GRAPH_CONSTRAINT_OPTIMIZE_UNREACHABLE_CODE);
+ add_irg_properties(irg, IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE);
/* invalidate infos */
- clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
- clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_LOOPINFO);
+ clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
+ clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
edges_deactivate(irg);
/* Finally kill BAD and doublets from the keep alives.
return true;
}
+void local_opts_const_code(void)
+{
+ ir_graph *irg = get_const_code_irg();
+ /* Clean the value_table in irg for the CSE. */
+ new_identities(irg);
+
+ walk_const_code(firm_clear_link, optimize_in_place_wrapper, NULL);
+}
+
ir_graph_pass_t *optimize_graph_df_pass(const char *name)
{
return def_graph_pass_ret(name ? name : "optimize_graph_df", optimize_graph_df);