Let list_for_each_entry(), list_for_each_entry_reverse() and list_for_each_entry_safe...
[libfirm] / ir / opt / convopt.c
index 18c0a46..ee9b382 100644 (file)
@@ -53,7 +53,6 @@
 #include "irpass_t.h"
 #include "tv.h"
 #include "vrp.h"
-#include "opt_manage.h"
 
 DEBUG_ONLY(static firm_dbg_module_t *dbg;)
 
@@ -303,38 +302,31 @@ static void conv_opt_walker(ir_node *node, void *data)
        }
 }
 
-static ir_graph_state_t do_deconv(ir_graph *irg)
+void conv_opt(ir_graph *irg)
 {
+       bool global_changed = false;
        bool changed;
        FIRM_DBG_REGISTER(dbg, "firm.opt.conv");
 
+       assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES);
+
        DB((dbg, LEVEL_1, "===> Performing conversion optimization on %+F\n", irg));
 
        do {
                changed = false;
                irg_walk_graph(irg, NULL, conv_opt_walker, &changed);
                local_optimize_graph(irg);
+               global_changed |= changed;
        } while (changed);
 
-       return 0;
-}
-
-static optdesc_t opt_deconv = {
-       "deconv",
-       IR_GRAPH_STATE_CONSISTENT_OUT_EDGES,
-       do_deconv,
-};
-
-int conv_opt(ir_graph *irg)
-{
-       perform_irg_optimization(irg, &opt_deconv);
-       return 1;
+       confirm_irg_properties(irg,
+               global_changed ? IR_GRAPH_PROPERTIES_NONE : IR_GRAPH_PROPERTIES_ALL);
 }
 
 /* Creates an ir_graph pass for conv_opt. */
 ir_graph_pass_t *conv_opt_pass(const char *name)
 {
-       ir_graph_pass_t *path = def_graph_pass_ret(name ? name : "conv_opt", conv_opt);
+       ir_graph_pass_t *path = def_graph_pass(name ? name : "conv_opt", conv_opt);
 
        /* safe to run parallel on all irgs */
        ir_graph_pass_set_parallel(path, 1);