Commit ac384815 authored by Andreas Zwinkau's avatar Andreas Zwinkau
Browse files

Remove entity_usage_state attribute

parent 3be74f06
......@@ -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.
*/
......
......@@ -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);
......
......@@ -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 --*/
......
......@@ -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. */
......
......@@ -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:
......
......@@ -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);
}
......
......@@ -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 */
......
......@@ -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:
......
......@@ -15,11 +15,6 @@
#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)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment