Remove entity_usage_state attribute
authorAndreas Zwinkau <zwinkau@kit.edu>
Wed, 14 Sep 2011 11:00:07 +0000 (13:00 +0200)
committerAndreas Zwinkau <zwinkau@kit.edu>
Wed, 14 Sep 2011 11:00:11 +0000 (13:00 +0200)
include/libfirm/irmemory.h
ir/ana/irmemory.c
ir/ir/irgraph.c
ir/ir/irtypes.h
ir/opt/cfopt.c
ir/opt/ldstopt.c
ir/opt/opt_inline.c
ir/opt/opt_ldst.c
ir/opt/opt_manage.c

index f14c137..dab1b37 100644 (file)
@@ -170,19 +170,11 @@ FIRM_API ir_alias_relation get_alias_relation_ex(
  */
 FIRM_API void mem_disambig_term(void);
 
-FIRM_API ir_entity_usage_computed_state get_irg_entity_usage_state(const ir_graph *irg);
-
-FIRM_API void set_irg_entity_usage_state(ir_graph *irg,
-                                         ir_entity_usage_computed_state state);
-
 /**
  * Assure that the entity usage flags have been computed for the given graph.
  *
  * This analysis computes the entity usage state for all local variables.
  *
- * Note that this is a conservative estimation that by no Firm transformation
- * can be invalidated, so it's only recomputed if manually triggered by calling
- * set_irg_entity_usage_state(irg, ir_entity_usage_not_computed).
  * Even then the information is not cleaned from the variables, call
  * assure_irg_entity_usage_computed() again for recomputation.
  */
index c0b3e5e..a201e4e 100644 (file)
@@ -1041,22 +1041,12 @@ static void analyse_irg_entity_usage(ir_graph *irg)
 
 
        /* now computed */
-       irg->entity_usage_state = ir_entity_usage_computed;
-}
-
-ir_entity_usage_computed_state get_irg_entity_usage_state(const ir_graph *irg)
-{
-       return irg->entity_usage_state;
-}
-
-void set_irg_entity_usage_state(ir_graph *irg, ir_entity_usage_computed_state state)
-{
-       irg->entity_usage_state = state;
+       set_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE);
 }
 
 void assure_irg_entity_usage_computed(ir_graph *irg)
 {
-       if (irg->entity_usage_state != ir_entity_usage_not_computed)
+       if (is_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE))
                return;
 
        analyse_irg_entity_usage(irg);
index 783d7a7..9059e85 100644 (file)
@@ -194,7 +194,6 @@ ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc)
        res->extblk_state        = ir_extblk_info_none;
        res->execfreq_state      = exec_freq_none;
        res->fp_model            = fp_model_precise;
-       res->entity_usage_state  = ir_entity_usage_not_computed;
        res->mem_disambig_opt    = aa_opt_inherited;
 
        /*-- Type information for the procedure of the graph --*/
index 3cfa904..3f3f313 100644 (file)
@@ -485,7 +485,6 @@ struct ir_graph {
        ir_class_cast_state   class_cast_state;  /**< Kind of cast operations in code. */
        irg_extblk_info_state extblk_state;      /**< State of extended basic block info. */
        exec_freq_state       execfreq_state;    /**< Execution frequency state. */
-       ir_entity_usage_computed_state entity_usage_state;
        unsigned mem_disambig_opt;               /**< Options for the memory disambiguator. */
        unsigned fp_model;                       /**< floating point model of the graph. */
 
index 021af88..b10dc51 100644 (file)
@@ -907,7 +907,7 @@ static ir_graph_state_t do_cfopt(ir_graph *irg)
 
                clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
                set_irg_extblk_inconsistent(irg);
-               set_irg_entity_usage_state(irg, ir_entity_usage_not_computed);
+               clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE);
        }
 
        /* assert due to collect_nodes:
index cb7986d..2cdb980 100644 (file)
@@ -2292,7 +2292,6 @@ static ir_graph_state_t do_loadstore_opt(ir_graph *irg)
 
        /* Handle graph state */
        if (env.changes) {
-               set_irg_entity_usage_state(irg, ir_entity_usage_not_computed);
                edges_deactivate(irg);
        }
 
index 92e1cf0..45f0dd9 100644 (file)
@@ -350,7 +350,7 @@ int inline_method(ir_node *call, ir_graph *called_graph)
        set_irg_extblk_inconsistent(irg);
        clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
        set_irg_callee_info_state(irg, irg_callee_info_inconsistent);
-       set_irg_entity_usage_state(irg, ir_entity_usage_not_computed);
+       clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE);
        edges_deactivate(irg);
 
        /* here we know we WILL inline, so inform the statistics */
index 5279d6b..f2a52bd 100644 (file)
@@ -2460,7 +2460,7 @@ int opt_ldst(ir_graph *irg)
                /* not only invalidate but free them. We might allocate new out arrays
                   on our obstack which will be deleted yet. */
                free_irg_outs(irg);
-               set_irg_entity_usage_state(irg, ir_entity_usage_not_computed);
+               clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE);
        }
 end:
 
index 4c73a1b..43399c5 100644 (file)
 #include "irdump.h"
 #include "opt_manage.h"
 
-static void deactivate_entity_usage(ir_graph *irg)
-{
-       set_irg_entity_usage_state(irg, ir_entity_usage_not_computed);
-}
-
 static void nop(ir_graph *irg) {
        (void)irg;
 }
@@ -38,8 +33,6 @@ void perform_irg_optimization(ir_graph *irg, optdesc_t *opt)
        // FIXME should not be necessary!
        if (loopinfo_inconsistent == get_irg_loopinfo_state(irg))
                clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_LOOPINFO);
-       if (ir_entity_usage_not_computed == get_irg_entity_usage_state(irg))
-               clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE);
 
        /* assure that all requirements for the optimization are fulfilled */
 #define PREPARE(st,func) if (st & (required ^ irg->state)) {func(irg); set_irg_state(irg,st);}
@@ -78,7 +71,7 @@ void perform_irg_optimization(ir_graph *irg, optdesc_t *opt)
        INVALIDATE(IR_GRAPH_STATE_CONSISTENT_OUTS,          nop)
        INVALIDATE(IR_GRAPH_STATE_CONSISTENT_OUT_EDGES,     edges_deactivate)
        INVALIDATE(IR_GRAPH_STATE_CONSISTENT_LOOPINFO,      set_irg_loopinfo_inconsistent)
-       INVALIDATE(IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE,  deactivate_entity_usage)
+       INVALIDATE(IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE,  nop)
        INVALIDATE(IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS,    set_irg_extblk_inconsistent)
 
        if (!(new_irg_state & IR_GRAPH_STATE_BROKEN_FOR_VERIFIER)) {