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

remove assure_doms from public API, use assure_irg_properties instead

parent 1ebb96b9
...@@ -178,9 +178,6 @@ FIRM_API void postdom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre, ...@@ -178,9 +178,6 @@ FIRM_API void postdom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre,
*/ */
FIRM_API void compute_doms(ir_graph *irg); FIRM_API void compute_doms(ir_graph *irg);
/** Recomputes dominator relation of a graph if necessary */
FIRM_API void assure_doms(ir_graph *irg);
/** Computes the post dominance relation for all basic blocks of a given graph. /** Computes the post dominance relation for all basic blocks of a given graph.
* *
* Sets a flag in irg to "dom_consistent". * Sets a flag in irg to "dom_consistent".
...@@ -198,9 +195,6 @@ FIRM_API void assure_doms(ir_graph *irg); ...@@ -198,9 +195,6 @@ FIRM_API void assure_doms(ir_graph *irg);
*/ */
FIRM_API void compute_postdoms(ir_graph *irg); FIRM_API void compute_postdoms(ir_graph *irg);
/** Recompute postdominance relation if necessary */
FIRM_API void assure_postdoms(ir_graph *irg);
/** Frees the dominance data structures. Sets the flag in irg to "dom_none". */ /** Frees the dominance data structures. Sets the flag in irg to "dom_none". */
FIRM_API void free_dom(ir_graph *irg); FIRM_API void free_dom(ir_graph *irg);
......
...@@ -130,7 +130,7 @@ void compute_cdep(ir_graph *irg) ...@@ -130,7 +130,7 @@ void compute_cdep(ir_graph *irg)
cdep_data->cdep_map = pmap_create(); cdep_data->cdep_map = pmap_create();
assure_postdoms(irg); assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_POSTDOMINANCE);
/* we must temporary change the post dominator relation: /* we must temporary change the post dominator relation:
the ipdom of the startblock is the end block. the ipdom of the startblock is the end block.
......
...@@ -80,10 +80,10 @@ void ir_compute_dominance_frontiers(ir_graph *irg) ...@@ -80,10 +80,10 @@ void ir_compute_dominance_frontiers(ir_graph *irg)
{ {
ir_dom_front_info_t *info = &irg->domfront; ir_dom_front_info_t *info = &irg->domfront;
assure_edges(irg); assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES
| IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
obstack_init(&info->obst); obstack_init(&info->obst);
info->df_map = pmap_create(); info->df_map = pmap_create();
assure_doms(irg);
compute_df(get_irg_start_block(irg), info); compute_df(get_irg_start_block(irg), info);
add_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE_FRONTIERS); add_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE_FRONTIERS);
......
...@@ -605,12 +605,6 @@ void compute_doms(ir_graph *irg) ...@@ -605,12 +605,6 @@ void compute_doms(ir_graph *irg)
add_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE); add_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
} }
void assure_doms(ir_graph *irg)
{
if (!irg_has_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE))
compute_doms(irg);
}
void free_dom(ir_graph *irg) void free_dom(ir_graph *irg)
{ {
clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE); clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
...@@ -701,12 +695,6 @@ void compute_postdoms(ir_graph *irg) ...@@ -701,12 +695,6 @@ void compute_postdoms(ir_graph *irg)
add_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_POSTDOMINANCE); add_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_POSTDOMINANCE);
} }
void assure_postdoms(ir_graph *irg)
{
if (!irg_has_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_POSTDOMINANCE))
compute_postdoms(irg);
}
void free_postdom(ir_graph *irg) void free_postdom(ir_graph *irg)
{ {
/* Update graph state */ /* Update graph state */
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "irnode_t.h" #include "irnode_t.h"
#include "irnodemap.h" #include "irnodemap.h"
#include "iredges_t.h" #include "iredges_t.h"
#include "irgraph_t.h"
#include "irdom.h" #include "irdom.h"
#include "irdump.h" #include "irdump.h"
...@@ -199,11 +200,11 @@ static inline void compute_back_edge_chains(lv_chk_t *lv) ...@@ -199,11 +200,11 @@ static inline void compute_back_edge_chains(lv_chk_t *lv)
lv_chk_t *lv_chk_new(ir_graph *irg) lv_chk_t *lv_chk_new(ir_graph *irg)
{ {
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
lv_chk_t *res = XMALLOC(lv_chk_t); lv_chk_t *res = XMALLOC(lv_chk_t);
int i; int i;
assure_doms(irg);
stat_ev_tim_push(); stat_ev_tim_push();
ir_nodemap_init(&res->block_infos, irg); ir_nodemap_init(&res->block_infos, irg);
obstack_init(&res->obst); obstack_init(&res->obst);
......
...@@ -335,8 +335,9 @@ static void be_ra_chordal_color(be_chordal_env_t *const chordal_env) ...@@ -335,8 +335,9 @@ static void be_ra_chordal_color(be_chordal_env_t *const chordal_env)
{ {
char buf[256]; char buf[256];
ir_graph *const irg = chordal_env->irg; ir_graph *const irg = chordal_env->irg;
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
be_assure_live_sets(irg); be_assure_live_sets(irg);
assure_doms(irg);
be_timer_push(T_CONSTR); be_timer_push(T_CONSTR);
......
...@@ -567,11 +567,11 @@ static void be_pbqp_coloring(be_chordal_env_t *env) ...@@ -567,11 +567,11 @@ static void be_pbqp_coloring(be_chordal_env_t *env)
printf("#### ----- === Allocating registers of %s (%s) ===\n", cls->name, get_entity_name(get_irg_entity(irg))); printf("#### ----- === Allocating registers of %s (%s) ===\n", cls->name, get_entity_name(get_irg_entity(irg)));
#endif #endif
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
be_assure_live_sets(irg); be_assure_live_sets(irg);
lv = be_get_irg_liveness(irg); lv = be_get_irg_liveness(irg);
/* insert perms */ /* insert perms */
assure_doms(irg);
dom_tree_walk_irg(irg, insert_perms, NULL, env); dom_tree_walk_irg(irg, insert_perms, NULL, env);
/* dump graph after inserting perms */ /* dump graph after inserting perms */
...@@ -621,7 +621,7 @@ static void be_pbqp_coloring(be_chordal_env_t *env) ...@@ -621,7 +621,7 @@ static void be_pbqp_coloring(be_chordal_env_t *env)
#if TIMER #if TIMER
ir_timer_reset_and_start(t_ra_pbqp_alloc_create); ir_timer_reset_and_start(t_ra_pbqp_alloc_create);
#endif #endif
assure_doms(irg); assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
dom_tree_walk_irg(irg, create_pbqp_coloring_instance , NULL, &pbqp_alloc_env); dom_tree_walk_irg(irg, create_pbqp_coloring_instance , NULL, &pbqp_alloc_env);
#if TIMER #if TIMER
ir_timer_stop(t_ra_pbqp_alloc_create); ir_timer_stop(t_ra_pbqp_alloc_create);
......
...@@ -463,8 +463,9 @@ void be_assure_state(ir_graph *irg, const arch_register_t *reg, void *func_env, ...@@ -463,8 +463,9 @@ void be_assure_state(ir_graph *irg, const arch_register_t *reg, void *func_env,
spill_info_t *info; spill_info_t *info;
be_lv_t *lv = be_get_irg_liveness(irg); be_lv_t *lv = be_get_irg_liveness(irg);
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO
| IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
be_assure_live_sets(irg); be_assure_live_sets(irg);
assure_loopinfo(irg);
obstack_init(&env.obst); obstack_init(&env.obst);
env.reg = reg; env.reg = reg;
...@@ -476,7 +477,6 @@ void be_assure_state(ir_graph *irg, const arch_register_t *reg, void *func_env, ...@@ -476,7 +477,6 @@ void be_assure_state(ir_graph *irg, const arch_register_t *reg, void *func_env,
env.spills = NULL; env.spills = NULL;
ir_nodehashmap_init(&env.spill_infos); ir_nodehashmap_init(&env.spill_infos);
assure_doms(irg);
ir_reserve_resources(irg, IR_RESOURCE_IRN_VISITED | IR_RESOURCE_IRN_LINK); ir_reserve_resources(irg, IR_RESOURCE_IRN_VISITED | IR_RESOURCE_IRN_LINK);
inc_irg_visited(irg); inc_irg_visited(irg);
......
...@@ -181,9 +181,8 @@ int optimize_graph_df(ir_graph *irg) ...@@ -181,9 +181,8 @@ int optimize_graph_df(ir_graph *irg)
add_irg_constraints(irg, IR_GRAPH_CONSTRAINT_OPTIMIZE_UNREACHABLE_CODE); add_irg_constraints(irg, IR_GRAPH_CONSTRAINT_OPTIMIZE_UNREACHABLE_CODE);
new_identities(irg); new_identities(irg);
assure_edges(irg); assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES
assure_doms(irg); | IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK); ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);
irg_walk_graph(irg, NULL, opt_walker, waitq); irg_walk_graph(irg, NULL, opt_walker, waitq);
...@@ -197,7 +196,8 @@ int optimize_graph_df(ir_graph *irg) ...@@ -197,7 +196,8 @@ int optimize_graph_df(ir_graph *irg)
opt_walker(n, waitq); opt_walker(n, waitq);
} }
/* Calculate dominance so we can kill unreachable code /* Calculate dominance so we can kill unreachable code
* We want this intertwined with localopts for better optimization (phase coupling) */ * We want this intertwined with localopts for better optimization
* (phase coupling) */
compute_doms(irg); compute_doms(irg);
irg_block_walk_graph(irg, NULL, find_unreachable_blocks, waitq); irg_block_walk_graph(irg, NULL, find_unreachable_blocks, waitq);
} }
......
...@@ -670,8 +670,8 @@ void assure_irg_properties(ir_graph *irg, ir_graph_properties_t props) ...@@ -670,8 +670,8 @@ void assure_irg_properties(ir_graph *irg, ir_graph_properties_t props)
{ IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE, remove_unreachable_code }, { IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE, remove_unreachable_code },
{ IR_GRAPH_PROPERTY_NO_BADS, remove_bads }, { IR_GRAPH_PROPERTY_NO_BADS, remove_bads },
{ IR_GRAPH_PROPERTY_NO_TUPLES, remove_tuples }, { IR_GRAPH_PROPERTY_NO_TUPLES, remove_tuples },
{ IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE, assure_doms }, { IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE, compute_doms },
{ IR_GRAPH_PROPERTY_CONSISTENT_POSTDOMINANCE, assure_postdoms }, { IR_GRAPH_PROPERTY_CONSISTENT_POSTDOMINANCE, compute_postdoms },
{ IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES, assure_edges }, { IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES, assure_edges },
{ IR_GRAPH_PROPERTY_CONSISTENT_OUTS, assure_irg_outs }, { IR_GRAPH_PROPERTY_CONSISTENT_OUTS, assure_irg_outs },
{ IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO, assure_loopinfo }, { IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO, assure_loopinfo },
......
...@@ -1111,7 +1111,7 @@ static void update_graph_stat(graph_entry_t *global, graph_entry_t *graph) ...@@ -1111,7 +1111,7 @@ static void update_graph_stat(graph_entry_t *global, graph_entry_t *graph)
/* we need dominator info */ /* we need dominator info */
if (graph->irg != get_const_code_irg()) { if (graph->irg != get_const_code_irg()) {
assure_doms(graph->irg); assure_irg_properties(graph->irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
} }
/* count the nodes in the graph */ /* count the nodes in the graph */
......
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