Commit c9a79dbf authored by Matthias Braun's avatar Matthias Braun
Browse files

push usage of assure_irg_properties/confirm_irg_properties in backend

parent 9a0042ee
...@@ -1481,6 +1481,8 @@ void be_abi_introduce(ir_graph *irg) ...@@ -1481,6 +1481,8 @@ void be_abi_introduce(ir_graph *irg)
{ {
be_timer_push(T_ABI); be_timer_push(T_ABI);
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES);
ir_node *const old_frame = get_irg_frame(irg); ir_node *const old_frame = get_irg_frame(irg);
const arch_env_t *const arch_env = be_get_irg_arch_env(irg); const arch_env_t *const arch_env = be_get_irg_arch_env(irg);
ir_entity *const entity = get_irg_entity(irg); ir_entity *const entity = get_irg_entity(irg);
...@@ -1509,8 +1511,6 @@ void be_abi_introduce(ir_graph *irg) ...@@ -1509,8 +1511,6 @@ void be_abi_introduce(ir_graph *irg)
env.init_sp = dummy; env.init_sp = dummy;
env.calls = NEW_ARR_F(ir_node*, 0); env.calls = NEW_ARR_F(ir_node*, 0);
assure_edges(irg);
/* Lower all call nodes in the IRG. */ /* Lower all call nodes in the IRG. */
process_calls(irg, &env); process_calls(irg, &env);
...@@ -1534,6 +1534,10 @@ void be_abi_introduce(ir_graph *irg) ...@@ -1534,6 +1534,10 @@ void be_abi_introduce(ir_graph *irg)
pmap_destroy(env.regs); pmap_destroy(env.regs);
confirm_irg_properties(irg, IR_GRAPH_PROPERTY_NO_BADS
| IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES
| IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE);
be_timer_pop(T_ABI); be_timer_pop(T_ABI);
} }
......
...@@ -395,34 +395,19 @@ static void initialize_birg(be_irg_t *birg, ir_graph *irg, be_main_env_t *env) ...@@ -395,34 +395,19 @@ static void initialize_birg(be_irg_t *birg, ir_graph *irg, be_main_env_t *env)
dump(DUMP_INITIAL, irg, "begin"); dump(DUMP_INITIAL, irg, "begin");
irg->be_data = birg; assure_irg_properties(irg,
IR_GRAPH_PROPERTY_NO_BADS
| IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE
| IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES
| IR_GRAPH_PROPERTY_MANY_RETURNS);
memset(birg, 0, sizeof(*birg)); memset(birg, 0, sizeof(*birg));
birg->main_env = env; birg->main_env = env;
obstack_init(&birg->obst); obstack_init(&birg->obst);
birg->lv = be_liveness_new(irg); irg->be_data = birg;
edges_deactivate(irg);
edges_activate(irg);
/* set the current graph (this is important for several firm functions) */
current_ir_graph = irg;
/* we do this before critical edge split. As this produces less returns,
because sometimes (= 164.gzip) multiple returns are slower */
normalize_n_returns(irg);
/* Remove critical edges */
remove_critical_cf_edges_ex(irg, /*ignore_exception_edges=*/0);
/* For code generation all unreachable code and Bad nodes should be gone */
remove_unreachable_code(irg);
remove_bads(irg);
/* Ensure, that the ir_edges are computed. */
assure_edges(irg);
be_info_init_irg(irg); be_info_init_irg(irg);
birg->lv = be_liveness_new(irg);
dump(DUMP_INITIAL, irg, "prepared"); dump(DUMP_INITIAL, irg, "prepared");
} }
...@@ -568,9 +553,6 @@ static void be_main_loop(FILE *file_handle, const char *cup_name) ...@@ -568,9 +553,6 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
if (get_entity_linkage(entity) & IR_LINKAGE_NO_CODEGEN) if (get_entity_linkage(entity) & IR_LINKAGE_NO_CODEGEN)
continue; continue;
/* set the current graph (this is important for several firm functions) */
current_ir_graph = irg;
if (stat_ev_enabled) { if (stat_ev_enabled) {
stat_ev_ctx_push_fmt("bemain_irg", "%+F", irg); stat_ev_ctx_push_fmt("bemain_irg", "%+F", irg);
stat_ev_ull("bemain_insns_start", be_count_insns(irg)); stat_ev_ull("bemain_insns_start", be_count_insns(irg));
...@@ -593,18 +575,6 @@ static void be_main_loop(FILE *file_handle, const char *cup_name) ...@@ -593,18 +575,6 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
if (arch_env->impl->init_graph) if (arch_env->impl->init_graph)
arch_env->impl->init_graph(irg); arch_env->impl->init_graph(irg);
/* We can't have Bad-blocks or critical edges in the backend.
* Before removing Bads, we remove unreachable code. */
optimize_graph_df(irg);
remove_critical_cf_edges(irg);
remove_bads(irg);
/* We often have dead code reachable through out-edges here. So for
* now we rebuild edges (as we need correct user count for code
* selection) */
edges_deactivate(irg);
edges_activate(irg);
dump(DUMP_PREPARED, irg, "before-code-selection"); dump(DUMP_PREPARED, irg, "before-code-selection");
/* perform codeselection */ /* perform codeselection */
......
...@@ -5502,6 +5502,8 @@ void ia32_transform_graph(ir_graph *irg) ...@@ -5502,6 +5502,8 @@ void ia32_transform_graph(ir_graph *irg)
initial_fpcw = NULL; initial_fpcw = NULL;
ia32_no_pic_adjust = false; ia32_no_pic_adjust = false;
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES);
old_initial_fpcw = be_get_initial_reg_value(irg, &ia32_registers[REG_FPCW]); old_initial_fpcw = be_get_initial_reg_value(irg, &ia32_registers[REG_FPCW]);
be_timer_push(T_HEIGHTS); be_timer_push(T_HEIGHTS);
......
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