X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbestat.c;h=155ed404cf69aabb7692235841e379a3431407df;hb=dcb0342ffc45ffe11ab32835a9673b8dd3b5ec2e;hp=a4f16aa74201d805aba6d53ae0e28efc86b498cd;hpb=0fbcef83aa6060534172bb13e71cdadb04428806;p=libfirm diff --git a/ir/be/bestat.c b/ir/be/bestat.c index a4f16aa74..155ed404c 100644 --- a/ir/be/bestat.c +++ b/ir/be/bestat.c @@ -87,7 +87,9 @@ static void check_reg_pressure_class(pressure_walker_env_t *env, if(max_live > env->max_pressure) env->max_pressure = max_live; +#ifdef FIRM_STATISTICS stat_be_block_regpressure(irg, block, max_live, cls->name); +#endif ir_nodeset_destroy(&live_nodes); } @@ -122,7 +124,6 @@ void be_do_stat_reg_pressure(be_irg_t *birg, const arch_register_class_t *cls) { typedef struct _estimate_irg_costs_env_t { - const arch_env_t *arch_env; ir_exec_freq *execfreqs; double costs; } estimate_irg_costs_env_t; @@ -140,11 +141,10 @@ static void estimate_block_costs(ir_node *block, void *data) env->costs += costs * get_block_execfreq(env->execfreqs, block); } -double be_estimate_irg_costs(ir_graph *irg, const arch_env_t *arch_env, ir_exec_freq *execfreqs) +double be_estimate_irg_costs(ir_graph *irg, ir_exec_freq *execfreqs) { estimate_irg_costs_env_t env; - env.arch_env = arch_env; env.execfreqs = execfreqs; env.costs = 0.0; @@ -155,11 +155,9 @@ double be_estimate_irg_costs(ir_graph *irg, const arch_env_t *arch_env, ir_exec_ -static be_node_stats_t *stats; - static void node_stat_walker(ir_node *irn, void *data) { - (void) data; + be_node_stats_t *const stats = data; /* if the node is a normal phi */ if(is_Phi(irn)) { @@ -186,10 +184,8 @@ static void node_stat_walker(ir_node *irn, void *data) void be_collect_node_stats(be_node_stats_t *new_stats, be_irg_t *birg) { - stats = new_stats; - - memset(stats, 0, sizeof(*stats)); - irg_walk_graph(birg->irg, NULL, node_stat_walker, NULL); + memset(new_stats, 0, sizeof(*new_stats)); + irg_walk_graph(birg->irg, NULL, node_stat_walker, new_stats); } void be_subtract_node_stats(be_node_stats_t *stats, be_node_stats_t *sub)