Commit 4b295e5b authored by Matthias Braun's avatar Matthias Braun
Browse files

use IR_GRAPH_STATE instead of irg_extblk_info_state

parent 76affb62
......@@ -317,15 +317,6 @@ typedef enum {
but the graph has been changed since. */
} irg_outs_state;
/** state: extended basic block state. */
typedef enum {
ir_extblk_info_none = 0, /**< No extended basic block information is constructed. Default. */
ir_extblk_info_valid = 1, /**< Extended basic block information is valid. */
ir_extblk_info_invalid = 2 /**< Extended basic block information is constructed but invalid. */
} irg_extblk_info_state;
FIRM_API irg_extblk_info_state get_irg_extblk_state(const ir_graph *irg);
FIRM_API void set_irg_extblk_inconsistent(ir_graph *irg);
/** state: callee_information_state
* Call nodes contain a list of possible callees. This list must be
* computed by an analysis.
......
......@@ -266,7 +266,7 @@ void compute_extbb(ir_graph *irg)
extbb->visited = 0;
}
irg->extblk_state = ir_extblk_info_valid;
set_irg_state(irg, IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
}
/* free all extended block info. */
......@@ -277,7 +277,7 @@ void free_extbb(ir_graph *irg)
xfree(irg->extbb_obst);
irg->extbb_obst = NULL;
}
irg->extblk_state = ir_extblk_info_none;
clear_irg_state(irg, IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
}
/* Return the extended block of a node. */
......
......@@ -243,5 +243,5 @@ void compute_extbb_execfreqs(ir_graph *irg, ir_exec_freq *execfreqs)
extbb->visited = 0;
}
irg->extblk_state = ir_extblk_info_valid;
set_irg_state(irg, IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
}
......@@ -263,8 +263,8 @@ int be_remove_empty_blocks(ir_graph *irg)
if (blocks_removed) {
/* invalidate analysis info */
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
set_irg_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
}
return blocks_removed;
}
......
......@@ -2277,7 +2277,7 @@ static void dump_blocks_extbb_grouped(FILE *F, ir_graph *irg)
size_t i;
ir_entity *ent = get_irg_entity(irg);
if (get_irg_extblk_state(irg) != ir_extblk_info_valid)
if (!is_irg_state(irg, IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS))
compute_extbb(irg);
construct_extblock_lists(irg);
......
......@@ -190,7 +190,6 @@ ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc)
set_irp_typeinfo_inconsistent(); /* there is a new graph with typeinfo_none. */
res->callee_info_state = irg_callee_info_none;
res->class_cast_state = ir_class_casts_transitive;
res->extblk_state = ir_extblk_info_none;
res->execfreq_state = exec_freq_none;
res->fp_model = fp_model_precise;
res->mem_disambig_opt = aa_opt_inherited;
......@@ -276,7 +275,6 @@ ir_graph *new_const_code_irg(void)
res->phase_state = phase_building;
res->irg_pinned_state = op_pin_state_pinned;
res->extblk_state = ir_extblk_info_none;
res->fp_model = fp_model_precise;
/* value table for global value numbering for optimizing use in iropt.c */
......@@ -385,7 +383,6 @@ ir_graph *create_irg_copy(ir_graph *irg)
res->phase_state = irg->phase_state;
res->irg_pinned_state = irg->irg_pinned_state;
res->extblk_state = ir_extblk_info_none;
res->fp_model = irg->fp_model;
new_identities(res);
......@@ -647,16 +644,6 @@ op_pin_state (get_irg_pinned)(const ir_graph *irg)
return _get_irg_pinned(irg);
}
irg_extblk_info_state (get_irg_extblk_state)(const ir_graph *irg)
{
return _get_irg_extblk_state(irg);
}
void (set_irg_extblk_inconsistent)(ir_graph *irg)
{
_set_irg_extblk_inconsistent(irg);
}
void (set_irg_pinned)(ir_graph *irg, op_pin_state p)
{
_set_irg_pinned(irg, p);
......
......@@ -240,17 +240,6 @@ static inline op_pin_state _get_irg_pinned(const ir_graph *irg)
return irg->irg_pinned_state;
}
static inline irg_extblk_info_state _get_irg_extblk_state(const ir_graph *irg)
{
return irg->extblk_state;
}
static inline void _set_irg_extblk_inconsistent(ir_graph *irg)
{
if (irg->extblk_state == ir_extblk_info_valid)
irg->extblk_state = ir_extblk_info_invalid;
}
static inline void _set_irg_pinned(ir_graph *irg, op_pin_state p)
{
irg->irg_pinned_state = p;
......@@ -487,8 +476,6 @@ static inline ir_phase *irg_get_phase(const ir_graph *irg, ir_phase_id id)
#define get_irg_phase_state(irg) _get_irg_phase_state(irg)
#define set_irg_phase_state(irg, state) _set_irg_phase_state(irg, state)
#define get_irg_pinned(irg) _get_irg_pinned(irg)
#define get_irg_extblk_state(irg) _get_irg_extblk_state(irg)
#define set_irg_extblk_inconsistent(irg) _set_irg_extblk_inconsistent(irg)
#define set_irg_pinned(irg, p) _set_irg_pinned(irg, p)
#define get_irg_callee_info_state(irg) _get_irg_callee_info_state(irg)
#define set_irg_callee_info_state(irg, s) _set_irg_callee_info_state(irg, s)
......
......@@ -482,7 +482,6 @@ struct ir_graph {
ir_typeinfo_state typeinfo_state; /**< Validity of type information. */
irg_callee_info_state callee_info_state; /**< Validity of callee information. */
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. */
unsigned mem_disambig_opt; /**< Options for the memory disambiguator. */
unsigned fp_model; /**< floating point model of the graph. */
......
......@@ -2585,8 +2585,8 @@ static void lower_irg(ir_graph *irg)
if (env->flags & CF_CHANGED) {
/* control flow changed, dominance info is invalid */
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
set_irg_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
}
edges_deactivate(irg);
}
......
......@@ -142,8 +142,8 @@ size_t lower_intrinsics(i_record *list, size_t length, int part_block_used)
set_irg_callee_info_state(irg, irg_callee_info_inconsistent);
/* Exception control flow might have changed / new block might have added. */
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
set_irg_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
/* Calls might be removed/added. */
set_trouts_inconsistent();
......
......@@ -355,8 +355,8 @@ void ir_lower_mode_b(ir_graph *irg, const lower_mode_b_config_t *nconfig)
if (n > 0) {
/* lowering might create new blocks, so be sure to handle this */
set_irg_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
edges_deactivate(irg);
}
}
......@@ -137,8 +137,8 @@ void lower_mux(ir_graph *irg, lower_mux_callback *cb_func)
/* Cleanup, verify the graph. */
ir_free_resources(irg, resources);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
set_irg_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
}
DEL_ARR_F(env.muxes);
}
......
......@@ -422,7 +422,7 @@ void lower_switch(ir_graph *irg, unsigned small_switch, unsigned spare_size,
if (env.changed) {
/* control flow changed */
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
set_irg_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
}
}
......@@ -905,9 +905,9 @@ static ir_graph_state_t do_cfopt(ir_graph *irg)
if (!changed)
break;
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
set_irg_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS
| IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE);
}
/* assert due to collect_nodes:
......
......@@ -105,8 +105,8 @@ 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_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
}
}
......
......@@ -1261,8 +1261,8 @@ int shape_blocks(ir_graph *irg)
if (res) {
/* control flow changed */
set_irg_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
/* Calls might be removed. */
set_trouts_inconsistent();
......
......@@ -347,8 +347,9 @@ 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_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS
| IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE);
set_irg_callee_info_state(irg, irg_callee_info_inconsistent);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE);
edges_deactivate(irg);
......
......@@ -63,7 +63,7 @@ void perform_irg_optimization(ir_graph *irg, optdesc_t *opt)
INVALIDATE(IR_GRAPH_STATE_CONSISTENT_OUT_EDGES, edges_deactivate)
INVALIDATE(IR_GRAPH_STATE_CONSISTENT_LOOPINFO, nop)
INVALIDATE(IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE, nop)
INVALIDATE(IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS, set_irg_extblk_inconsistent)
INVALIDATE(IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS, nop)
remove_End_Bads_and_doublets(get_irg_end(irg));
......
......@@ -162,8 +162,8 @@ void normalize_one_return(ir_graph *irg)
* a new Block was added, so dominator, outs and loop are inconsistent,
* trouts and callee-state should be still valid
*/
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
set_irg_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
}
/* Create a graph pass. */
......@@ -381,8 +381,8 @@ void normalize_n_returns(ir_graph *irg)
| IR_GRAPH_STATE_ONE_RETURN
| IR_GRAPH_STATE_CONSISTENT_OUTS
| IR_GRAPH_STATE_NO_UNREACHABLE_CODE
| IR_GRAPH_STATE_NO_BADS);
set_irg_extblk_inconsistent(irg); /* may not be needed */
| IR_GRAPH_STATE_NO_BADS
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
}
/* Create a graph pass. */
......
......@@ -152,8 +152,8 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env)
assert(env->n_tail_calls > 0);
/* we add new blocks and change the control flow */
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
set_irg_extblk_inconsistent(irg);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
/* calls are removed */
set_trouts_inconsistent();
......@@ -266,8 +266,8 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env)
/* tail recursion was done, all info is invalid */
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_CONSISTENT_LOOPINFO);
set_irg_extblk_inconsistent(irg);
| IR_GRAPH_STATE_CONSISTENT_LOOPINFO
| IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
set_trouts_inconsistent();
set_irg_callee_info_state(irg, irg_callee_info_inconsistent);
......
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