Commit 3bb47464 authored by Matthias Braun's avatar Matthias Braun
Browse files

remove loopinfo stuff and exclusively use IR_GRAPH_STATE_CONSISTENT_LOOPINFO

parent 4ebb78a2
......@@ -989,7 +989,7 @@ void inline_leave_functions(unsigned maxsize, unsigned leavesize,
assert(get_irg_phase_state(irg) != phase_building);
free_callee_info(irg);
assure_cf_loop(irg);
assure_loopinfo(irg);
wenv.x = (inline_irg_env*)get_irg_link(irg);
irg_walk_graph(irg, NULL, collect_calls2, &wenv);
}
......@@ -1116,7 +1116,7 @@ void inline_leave_functions(unsigned maxsize, unsigned leavesize,
callee_env = alloc_inline_irg_env();
set_irg_link(copy, callee_env);
assure_cf_loop(copy);
assure_loopinfo(copy);
wenv.x = callee_env;
wenv.ignore_callers = 1;
irg_walk_graph(copy, NULL, collect_calls2, &wenv);
......@@ -1652,7 +1652,7 @@ static void inline_into(ir_graph *irg, unsigned maxsize,
callee_env = alloc_inline_irg_env();
set_irg_link(copy, callee_env);
assure_cf_loop(copy);
assure_loopinfo(copy);
memset(&wenv, 0, sizeof(wenv));
wenv.x = callee_env;
wenv.ignore_callers = 1;
......@@ -1764,7 +1764,7 @@ void inline_functions(unsigned maxsize, int inline_threshold,
free_callee_info(irg);
wenv.x = (inline_irg_env*)get_irg_link(irg);
assure_cf_loop(irg);
assure_loopinfo(irg);
irg_walk_graph(irg, NULL, collect_calls2, &wenv);
}
......
......@@ -25,11 +25,6 @@ void perform_irg_optimization(ir_graph *irg, optdesc_t *opt)
ir_graph_state_t required = opt->requirements;
const bool dump = get_irp_optimization_dumps();
/** Some workarounds because information is currently duplicated */
// FIXME should not be necessary!
if (loopinfo_inconsistent == get_irg_loopinfo_state(irg))
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_LOOPINFO);
/* 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);}
PREPARE(IR_GRAPH_STATE_ONE_RETURN, normalize_one_return)
......@@ -40,7 +35,7 @@ void perform_irg_optimization(ir_graph *irg, optdesc_t *opt)
PREPARE(IR_GRAPH_STATE_CONSISTENT_POSTDOMINANCE, assure_postdoms)
PREPARE(IR_GRAPH_STATE_CONSISTENT_OUT_EDGES, edges_assure)
PREPARE(IR_GRAPH_STATE_CONSISTENT_OUTS, assure_irg_outs)
PREPARE(IR_GRAPH_STATE_CONSISTENT_LOOPINFO, assure_cf_loop)
PREPARE(IR_GRAPH_STATE_CONSISTENT_LOOPINFO, assure_loopinfo)
PREPARE(IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE, assure_irg_entity_usage_computed)
PREPARE(IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS, compute_extbb)
......@@ -66,7 +61,7 @@ void perform_irg_optimization(ir_graph *irg, optdesc_t *opt)
INVALIDATE(IR_GRAPH_STATE_CONSISTENT_POSTDOMINANCE, nop)
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_LOOPINFO, nop)
INVALIDATE(IR_GRAPH_STATE_CONSISTENT_ENTITY_USAGE, nop)
INVALIDATE(IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS, set_irg_extblk_inconsistent)
......
......@@ -925,7 +925,6 @@ static void reverse_rules(ir_node *node, void *env)
int optimize_reassociation(ir_graph *irg)
{
walker_t env;
irg_loopinfo_state state;
assert(get_irg_phase_state(irg) != phase_building);
assert(get_irg_pinned(irg) != op_pin_state_floats &&
......@@ -942,13 +941,8 @@ int optimize_reassociation(ir_graph *irg)
/*
* Calculate loop info, so we could identify loop-invariant
* code and treat it like a constant.
* We only need control flow loops here but can handle generic
* INTRA info as well.
*/
state = get_irg_loopinfo_state(irg);
if ((state & loopinfo_inter) ||
(state & (loopinfo_constructed | loopinfo_valid)) != (loopinfo_constructed | loopinfo_valid))
construct_cf_backedges(irg);
assure_loopinfo(irg);
env.changes = 0;
env.irg = irg;
......
......@@ -265,9 +265,9 @@ 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);
clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
| IR_GRAPH_STATE_CONSISTENT_LOOPINFO);
set_irg_extblk_inconsistent(irg);
set_irg_loopinfo_state(irg, loopinfo_cf_inconsistent);
set_trouts_inconsistent();
set_irg_callee_info_state(irg, irg_callee_info_inconsistent);
......
Supports Markdown
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