split irg and irp resources, add IRP_RESOURCE_TYPE_LINK
[libfirm] / ir / opt / gvn_pre.c
index 9be72d7..e6702a2 100644 (file)
@@ -191,7 +191,7 @@ static int is_nice_value(ir_node *n)
                return 0;
        mode = get_irn_mode(n);
        if (!mode_is_data(mode)) {
-               if (! is_Div(n) && ! is_Mod(n) && ! is_DivMod(n))
+               if (! is_Div(n) && ! is_Mod(n))
                        return 0;
                if (! is_NoMem(get_fragile_op_mem(n)))
                        return 0;
@@ -537,7 +537,7 @@ static void compute_antic(ir_node *block, void *ctx)
 static void insert_nodes(ir_node *block, void *ctx)
 {
        pre_env    *env = (pre_env*)ctx;
-       ir_node    *value, *expr, *idom, *first_s, *worklist;
+       ir_node    *value, *expr, *idom, *first_s;
        block_info *curr_info, *idom_info;
        int        pos, arity = get_irn_arity(block);
        int        all_same, by_some, updated;
@@ -571,7 +571,6 @@ static void insert_nodes(ir_node *block, void *ctx)
 
        /* convert the set into a list. This allows the removal of
         * elements from the set */
-       worklist = NULL;
        foreach_valueset(curr_info->antic_in, value, expr, iter) {
                ir_mode *mode;
 
@@ -640,7 +639,7 @@ static void insert_nodes(ir_node *block, void *ctx)
                                /* ignore bad blocks. */
                                if (is_Bad(pred_blk)) {
                                        ir_graph *irg = get_irn_irg(pred_blk);
-                                       in[pos] = new_r_Bad(irg);
+                                       in[pos] = new_r_Bad(irg, mode_X);
                                        continue;
                                }
 
@@ -892,11 +891,6 @@ void do_gvn_pre(ir_graph *irg)
        /* pin the graph again: This is needed due to the use of set_opt_global_cse(1) */
        set_irg_pinned(irg, op_pin_state_pinned);
        restore_optimization_state(&state);
-
-       if (a_env.pairs) {
-               set_irg_outs_inconsistent(irg);
-               set_irg_loopinfo_inconsistent(irg);
-       }
 }  /* do_gvn_pre */
 
 /* Creates an ir_graph pass for do_gvn_pre. */