*/
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.
*/
/* 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);
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 --*/
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. */
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:
/* Handle graph state */
if (env.changes) {
- set_irg_entity_usage_state(irg, ir_entity_usage_not_computed);
edges_deactivate(irg);
}
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 */
/* 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:
#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;
}
// 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);}
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)) {