Remove obsolete outs invalidation
authorAndreas Zwinkau <zwinkau@kit.edu>
Mon, 9 May 2011 08:52:41 +0000 (10:52 +0200)
committerAndreas Zwinkau <zwinkau@kit.edu>
Mon, 9 May 2011 09:14:12 +0000 (11:14 +0200)
34 files changed:
ir/ana/irconsconfirm.c
ir/be/beirgmod.c
ir/ir/irgopt.c
ir/ir/iropt.c
ir/lower/lower_calls.c
ir/lower/lower_copyb.c
ir/lower/lower_dw.c
ir/lower/lower_hl.c
ir/lower/lower_intrinsics.c
ir/lower/lower_mode_b.c
ir/lower/lower_mux.c
ir/lower/lower_switch.c
ir/opt/boolopt.c
ir/opt/cfopt.c
ir/opt/code_placement.c
ir/opt/combo.c
ir/opt/convopt.c
ir/opt/critical_edges.c
ir/opt/escape_ana.c
ir/opt/fp-vrp.c
ir/opt/funccall.c
ir/opt/gvn_pre.c
ir/opt/ifconv.c
ir/opt/jumpthreading.c
ir/opt/ldstopt.c
ir/opt/loop.c
ir/opt/opt_blocks.c
ir/opt/opt_inline.c
ir/opt/opt_osr.c
ir/opt/reassoc.c
ir/opt/return.c
ir/opt/scalar_replace.c
ir/opt/tailrec.c
ir/opt/tropt.c

index c2821fb..69598b6 100644 (file)
@@ -593,9 +593,6 @@ void construct_confirms(ir_graph *irg)
        }
 
        if (env.num_confirms | env.num_consts | env.num_eq) {
-               /* we have add nodes or changed DF edges */
-               set_irg_outs_inconsistent(irg);
-
                /* the new nodes are not in the loop info */
                set_irg_loopinfo_inconsistent(irg);
        }
index 6b44f64..6c19e88 100644 (file)
@@ -268,7 +268,6 @@ int be_remove_empty_blocks(ir_graph *irg)
                /* invalidate analysis info */
                set_irg_doms_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
-               set_irg_outs_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
        }
        return blocks_removed;
index e14267a..6afd229 100644 (file)
@@ -78,7 +78,6 @@ static inline void do_local_optimize(ir_node *n)
 
        if (get_opt_global_cse())
                set_irg_pinned(irg, op_pin_state_floats);
-       set_irg_outs_inconsistent(irg);
        set_irg_doms_inconsistent(irg);
        set_irg_loopinfo_inconsistent(irg);
 
@@ -296,7 +295,6 @@ int optimize_graph_df(ir_graph *irg)
        set_irg_state(irg, IR_GRAPH_STATE_BAD_BLOCK);
 
        /* invalidate info */
-       set_irg_outs_inconsistent(irg);
        set_irg_doms_inconsistent(irg);
        set_irg_loopinfo_inconsistent(irg);
 
@@ -316,7 +314,6 @@ int optimize_graph_df(ir_graph *irg)
                        opt_walker(n, waitq);
                }
                /* kill newly generated unreachable code */
-               set_irg_outs_inconsistent(irg);
                compute_doms(irg);
                irg_block_walk_graph(irg, NULL, kill_dead_blocks, waitq);
        } while (! pdeq_empty(waitq));
@@ -335,7 +332,6 @@ int optimize_graph_df(ir_graph *irg)
 
        if (remove_Bads(irg)) {
                edges_deactivate(irg);
-               set_irg_outs_inconsistent(irg);
        }
 
        clear_irg_state(irg, IR_GRAPH_STATE_BAD_BLOCK);
index 3fa187a..cad73da 100644 (file)
@@ -6410,8 +6410,6 @@ ir_node *optimize_in_place(ir_node *n)
 
        if (get_opt_global_cse())
                set_irg_pinned(irg, op_pin_state_floats);
-       if (get_irg_outs_state(irg) == outs_consistent)
-               set_irg_outs_inconsistent(irg);
 
        /* FIXME: Maybe we could also test whether optimizing the node can
           change the control graph. */
index 6fdd20b..7560d6d 100644 (file)
@@ -764,7 +764,6 @@ static void transform_irg(const lower_params_t *lp, ir_graph *irg)
 
        if (env.changed) {
                /* invalidate the analysis info */
-               set_irg_outs_inconsistent(irg);
                set_irg_loopinfo_state(irg, loopinfo_inconsistent);
        }
        current_ir_graph = rem;
index 963900b..435d42e 100644 (file)
@@ -181,7 +181,6 @@ void lower_CopyB(ir_graph *irg, unsigned max_size, unsigned native_mode_bytes)
        }
 
        if (changed) {
-               set_irg_outs_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
        }
 
index 936e07c..8271b7b 100644 (file)
@@ -2319,9 +2319,6 @@ static void lower_irg(lower_env_t *env, ir_graph *irg)
 
                ir_free_resources(irg, IR_RESOURCE_IRN_VISITED);
 
-               /* outs are invalid, we changed the graph */
-               set_irg_outs_inconsistent(irg);
-
                if (env->flags & CF_CHANGED) {
                        /* control flow changed, dominance info is invalid */
                        set_irg_doms_inconsistent(irg);
index 6214abe..cffbf59 100644 (file)
@@ -523,8 +523,6 @@ void lower_highlevel_graph(ir_graph *irg, int lower_bitfields)
 
        /* Finally: lower SymConst-Size and Sel nodes, Casts, unaligned Load/Stores. */
        irg_walk_graph(irg, NULL, lower_irnode, NULL);
-
-       set_irg_outs_inconsistent(irg);
 }
 
 typedef struct pass_t {
index 705e7f1..4768bf2 100644 (file)
@@ -139,7 +139,6 @@ size_t lower_intrinsics(i_record *list, size_t length, int part_block_used)
 
                if (wenv.nr_of_intrinsics > 0) {
                        /* Changes detected: we might have added/removed nodes. */
-                       set_irg_outs_inconsistent(irg);
                        set_irg_callee_info_state(irg, irg_callee_info_inconsistent);
 
                        /* Exception control flow might have changed / new block might have added. */
index 1c3dce6..1e55f08 100644 (file)
@@ -457,7 +457,6 @@ void ir_lower_mode_b(ir_graph *irg, const lower_mode_b_config_t *nconfig)
        ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
 
        if (changed) {
-               set_irg_outs_inconsistent(irg);
                /* lowering might create new blocks, so be sure to handle this */
                set_irg_extblk_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
index e1c80c0..299b312 100644 (file)
@@ -137,7 +137,6 @@ void lower_mux(ir_graph *irg, lower_mux_callback *cb_func)
                /* Cleanup, verify the graph. */
                ir_free_resources(irg, resources);
 
-               set_irg_outs_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
index 28badb3..e44bd5f 100644 (file)
@@ -421,7 +421,6 @@ void lower_switch(ir_graph *irg, unsigned spare_size, int allow_out_of_bounds)
 
        if (env.changed) {
                /* control flow changed */
-               set_irg_outs_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
index 0e5cb3e..3e633bb 100644 (file)
@@ -738,7 +738,6 @@ void opt_bool(ir_graph *const irg)
        irg_block_walk_graph(irg, NULL, find_cf_and_or_walker, &env);
 
        if (env.changed) {
-               set_irg_outs_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
index 766bc0c..8d6096a 100644 (file)
@@ -602,7 +602,6 @@ restart:
 
        if (env.changed) {
                /* Handle graph state if was changed. */
-               set_irg_outs_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
@@ -634,10 +633,6 @@ restart:
                n = get_End_n_keepalives(end);
                if (n > 0) {
                        NEW_ARR_A(ir_node *, in, n);
-                       if (env.changed) {
-                               /* Handle graph state if was changed. */
-                               set_irg_outs_inconsistent(irg);
-                       }
                        assure_irg_outs(irg);
 
                        for (i = j = 0; i < n; ++i) {
@@ -668,7 +663,6 @@ restart:
 
        if (env.changed) {
                /* Handle graph state if was changed. */
-               set_irg_outs_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
index 581da79..72fbdb9 100644 (file)
@@ -429,7 +429,6 @@ void place_code(ir_graph *irg)
           unnecessary executions of the node. */
        place_late(irg, worklist);
 
-       set_irg_outs_inconsistent(irg);
        set_irg_loopinfo_inconsistent(irg);
        del_waitq(worklist);
 }
index 3278a72..d234258 100644 (file)
@@ -3595,7 +3595,6 @@ void combo(ir_graph *irg)
 
        if (env.modified) {
                /* control flow might changed */
-               set_irg_outs_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
index 9785dea..e3b0e25 100644 (file)
@@ -315,9 +315,6 @@ int conv_opt(ir_graph *irg)
                invalidate |= changed;
        } while (changed);
 
-       if (invalidate) {
-               set_irg_outs_inconsistent(irg);
-       }
        return invalidate;
 }
 
index b82f3a7..4d8eaba 100644 (file)
@@ -105,7 +105,6 @@ void remove_critical_cf_edges_ex(ir_graph *irg, int ignore_exception_edges)
        irg_block_walk_graph(irg, NULL, walk_critical_cf_edges, &env);
        if (env.changed) {
                /* control flow changed */
-               set_irg_outs_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
index ea8dd5c..9ecc50b 100644 (file)
@@ -460,13 +460,9 @@ static void transform_allocs(ir_graph *irg, walk_env_t *env)
   }
 
   /* if allocs were removed somehow */
-  if (env->nr_removed | env->nr_deads) {
-    set_irg_outs_inconsistent(irg);
-
-    if (env->nr_deads) {
-      /* exception control flow might have been changed */
-      set_irg_doms_inconsistent(irg);
-    }
+  if (env->nr_removed && env->nr_deads) {
+         /* exception control flow might have been changed */
+         set_irg_doms_inconsistent(irg);
   }
 }
 
index 3719d6c..dfa0e0b 100644 (file)
@@ -860,7 +860,6 @@ void fixpoint_vrp(ir_graph* const irg)
 
        if (env.modified) {
                /* control flow might changed */
-               set_irg_outs_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
index eec1b36..256e32c 100644 (file)
@@ -239,7 +239,6 @@ static void fix_const_call_lists(ir_graph *irg, env_t *ctx)
        }
 
        /* changes were done ... */
-       set_irg_outs_inconsistent(irg);
        set_irg_loopinfo_state(irg, loopinfo_cf_inconsistent);
 
        if (exc_changed) {
@@ -374,7 +373,6 @@ static void fix_nothrow_call_list(ir_graph *irg, ir_node *call_list, ir_node *pr
        }
 
        /* changes were done ... */
-       set_irg_outs_inconsistent(irg);
        set_irg_loopinfo_state(irg, loopinfo_cf_inconsistent);
 
        if (exc_changed) {
index 8ef34a4..d0c70b3 100644 (file)
@@ -894,7 +894,6 @@ void do_gvn_pre(ir_graph *irg)
        restore_optimization_state(&state);
 
        if (a_env.pairs) {
-               set_irg_outs_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
        }
 }  /* do_gvn_pre */
index b22c9db..607488c 100644 (file)
@@ -494,7 +494,6 @@ void opt_if_conv(ir_graph *irg)
                local_optimize_graph(irg);
 
                /* graph has changed, invalidate analysis info */
-               set_irg_outs_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
index 095f6a0..34aff8a 100644 (file)
@@ -766,7 +766,6 @@ void opt_jumpthreading(ir_graph* irg)
 
        if (changed) {
                /* control flow changed, some blocks may become dead */
-               set_irg_outs_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
index c9f84c8..4e19e21 100644 (file)
@@ -2283,7 +2283,6 @@ int optimize_load_store(ir_graph *irg)
 
        /* Handle graph state */
        if (env.changes) {
-               set_irg_outs_inconsistent(irg);
                set_irg_entity_usage_state(irg, ir_entity_usage_not_computed);
        }
 
index 7d88ca5..68ad703 100644 (file)
@@ -1396,8 +1396,6 @@ static void loop_inversion(void)
                set_irg_doms_inconsistent(current_ir_graph);
                /* Loop content changed */
                set_irg_loopinfo_inconsistent(current_ir_graph);
-               /* TODO are they? Depends on set_irn_in and set_irn_n exchange and new_node. */
-               set_irg_outs_inconsistent(current_ir_graph);
 
                count_stats(stats.inverted);
        }
@@ -2633,8 +2631,6 @@ static void unroll_loop(void)
 
                set_irg_doms_inconsistent(current_ir_graph);
                set_irg_loopinfo_inconsistent(current_ir_graph);
-               /* TODO is it? */
-               set_irg_outs_inconsistent(current_ir_graph);
 
                DEL_ARR_F(loop_entries);
        }
index a2a0452..101c6a1 100644 (file)
@@ -1265,7 +1265,6 @@ int shape_blocks(ir_graph *irg)
 
        if (res) {
                /* control flow changed */
-               set_irg_outs_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
index 5c6f711..cdb724c 100644 (file)
@@ -343,7 +343,6 @@ int inline_method(ir_node *call, ir_graph *called_graph)
        assert(get_irg_phase_state(irg) != phase_building);
        assert(get_irg_pinned(irg) == op_pin_state_pinned);
        assert(get_irg_pinned(called_graph) == op_pin_state_pinned);
-       set_irg_outs_inconsistent(irg);
        set_irg_extblk_inconsistent(irg);
        set_irg_doms_inconsistent(irg);
        set_irg_loopinfo_inconsistent(irg);
index 9f8043e..8abe299 100644 (file)
@@ -1275,7 +1275,6 @@ static void lftr(ir_graph *irg, iv_env *env)
  */
 static void clear_and_fix(ir_node *irn, void *env)
 {
-       int *moved = (int*)env;
        set_irn_link(irn, NULL);
 
        if (is_Proj(irn)) {
@@ -1284,7 +1283,6 @@ static void clear_and_fix(ir_node *irn, void *env)
 
                if (get_nodes_block(irn) != pred_block) {
                        set_nodes_block(irn, pred_block);
-                       *moved = 1;
                }
        }
 }  /* clear_and_fix */
@@ -1294,7 +1292,6 @@ static void clear_and_fix(ir_node *irn, void *env)
 void remove_phi_cycles(ir_graph *irg)
 {
        iv_env env;
-       int    projs_moved;
 
        FIRM_DBG_REGISTER(dbg, "firm.opt.remove_phi");
 
@@ -1317,10 +1314,7 @@ void remove_phi_cycles(ir_graph *irg)
         * the same block as their predecessors.
         * This can improve the placement of new nodes.
         */
-       projs_moved = 0;
-       irg_walk_graph(irg, NULL, clear_and_fix, &projs_moved);
-       if (projs_moved)
-               set_irg_outs_inconsistent(irg);
+       irg_walk_graph(irg, NULL, clear_and_fix, NULL);
 
        /* we need outs for calculating the post order */
        assure_irg_outs(irg);
@@ -1334,7 +1328,6 @@ void remove_phi_cycles(ir_graph *irg)
        ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
 
        if (env.replaced) {
-               set_irg_outs_inconsistent(irg);
                DB((dbg, LEVEL_1, "remove_phi_cycles: %u Cycles removed\n\n", env.replaced));
        }
 
@@ -1420,7 +1413,6 @@ void opt_osr(ir_graph *irg, unsigned flags)
 {
        iv_env   env;
        int      edges;
-       int      projs_moved;
 
        FIRM_DBG_REGISTER(dbg, "firm.opt.osr");
 
@@ -1443,10 +1435,7 @@ void opt_osr(ir_graph *irg, unsigned flags)
         * the same block as its predecessors.
         * This can improve the placement of new nodes.
         */
-       projs_moved = 0;
-       irg_walk_graph(irg, NULL, clear_and_fix, &projs_moved);
-       if (projs_moved)
-               set_irg_outs_inconsistent(irg);
+       irg_walk_graph(irg, NULL, clear_and_fix, NULL);
 
        /* we need dominance */
        assure_doms(irg);
@@ -1469,7 +1458,6 @@ void opt_osr(ir_graph *irg, unsigned flags)
                lftr(irg, &env);
                (void)lftr;
 
-               set_irg_outs_inconsistent(irg);
                DB((dbg, LEVEL_1, "Replacements: %u + %u (lftr)\n\n", env.replaced, env.lftr_replaced));
        }
        ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
index ac9febd..243d486 100644 (file)
@@ -970,7 +970,6 @@ int optimize_reassociation(ir_graph *irg)
 
        /* Handle graph state */
        if (env.changes) {
-               set_irg_outs_inconsistent(irg);
                set_irg_loopinfo_inconsistent(irg);
        }
 
index 4b20cf3..3b11e14 100644 (file)
@@ -163,7 +163,6 @@ void normalize_one_return(ir_graph *irg)
         * trouts and callee-state should be still valid
         */
        set_irg_doms_inconsistent(irg);
-       set_irg_outs_inconsistent(irg);
        set_irg_extblk_inconsistent(irg);
        set_irg_loopinfo_inconsistent(irg);
 }
@@ -380,7 +379,6 @@ void normalize_n_returns(ir_graph *irg)
         */
        set_irg_doms_inconsistent(irg);
        set_irg_extblk_inconsistent(irg);  /* may not be needed */
-       set_irg_outs_inconsistent(irg);
        set_irg_loopinfo_inconsistent(irg);
 }
 
index 465f455..306c0eb 100644 (file)
@@ -767,7 +767,6 @@ int scalar_replacement_opt(ir_graph *irg)
                         * neither changed control flow, cf-backedges should be still
                         * consistent.
                         */
-                       set_irg_outs_inconsistent(irg);
                        set_irg_loopinfo_inconsistent(irg);
 
                        res = 1;
index d1af572..02000c4 100644 (file)
@@ -151,9 +151,6 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env)
 
        assert(env->n_tail_calls > 0);
 
-       /* we add new nodes, so the outs are inconsistent */
-       set_irg_outs_inconsistent(irg);
-
        /* we add new blocks and change the control flow */
        set_irg_doms_inconsistent(irg);
        set_irg_extblk_inconsistent(irg);
@@ -274,7 +271,6 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env)
 
        /* tail recursion was done, all info is invalid */
        set_irg_doms_inconsistent(irg);
-       set_irg_outs_inconsistent(irg);
        set_irg_extblk_inconsistent(irg);
        set_irg_loopinfo_state(irg, loopinfo_cf_inconsistent);
        set_trouts_inconsistent();
index 16b9ab4..939a9c3 100644 (file)
@@ -492,8 +492,6 @@ void optimize_class_casts(void)
                size_t i, n;
 
                set_trouts_inconsistent();
-               for (i = 0, n = get_irp_n_irgs(); i < n; ++i)
-                       set_irg_outs_inconsistent(get_irp_irg(i));
        }
 
        DB((dbg, SET_LEVEL_1, " Cast optimization: %zu Casts removed, %zu Sels concretized.\n",