From: Christoph Mallon Date: Sat, 11 Oct 2008 20:55:53 +0000 (+0000) Subject: Remove the unused attribute const arch_env_t *arch_env from struct estimate_irg_costs... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;ds=sidebyside;h=cabe54a4c9fe9bcd6e66a221fde914c7e16e274f;p=libfirm Remove the unused attribute const arch_env_t *arch_env from struct estimate_irg_costs_env_t and also the then unused parameter const arch_env_t *arch_env from be_estimate_irg_costs(). [r22757] --- diff --git a/ir/be/bechordal_main.c b/ir/be/bechordal_main.c index 4332d3255..c81b3bd44 100644 --- a/ir/be/bechordal_main.c +++ b/ir/be/bechordal_main.c @@ -225,7 +225,6 @@ static void pre_spill(post_spill_env_t *pse, const arch_register_class_t *cls) be_chordal_env_t *chordal_env = &pse->cenv; be_irg_t *birg = pse->birg; ir_graph *irg = be_get_birg_irg(birg); - const be_main_env_t *main_env = birg->main_env; pse->cls = cls; chordal_env->cls = cls; @@ -235,7 +234,7 @@ static void pre_spill(post_spill_env_t *pse, const arch_register_class_t *cls) be_assure_liveness(birg); be_liveness_assure_chk(be_get_birg_liveness(birg)); - stat_ev_do(pse->pre_spill_cost = be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq)); + stat_ev_do(pse->pre_spill_cost = be_estimate_irg_costs(irg, birg->exec_freq)); /* put all ignore registers into the ignore register set. */ be_put_ignore_regs(birg, pse->cls, chordal_env->ignore_colors); @@ -254,13 +253,12 @@ static void post_spill(post_spill_env_t *pse, int iteration) { be_chordal_env_t *chordal_env = &pse->cenv; be_irg_t *birg = pse->birg; ir_graph *irg = birg->irg; - const be_main_env_t *main_env = birg->main_env; - int colors_n = arch_register_class_n_regs(chordal_env->cls); + int colors_n = arch_register_class_n_regs(chordal_env->cls); int allocatable_regs = colors_n - be_put_ignore_regs(birg, chordal_env->cls, NULL); /* some special classes contain only ignore regs, no work to be done */ if (allocatable_regs > 0) { - stat_ev_dbl("bechordal_spillcosts", be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq) - pse->pre_spill_cost); + stat_ev_dbl("bechordal_spillcosts", be_estimate_irg_costs(irg, birg->exec_freq) - pse->pre_spill_cost); /* If we have a backend provided spiller, post spill is diff --git a/ir/be/bemain.c b/ir/be/bemain.c index 9f725265f..81f137e03 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -752,7 +752,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name) stat_ev_if { stat_ev_dbl("bemain_costs_before_ra", - be_estimate_irg_costs(irg, arch_env, birg->exec_freq)); + be_estimate_irg_costs(irg, birg->exec_freq)); be_stat_ev("bemain_insns_before_ra", be_count_insns(irg)); be_stat_ev("bemain_blocks_before_ra", be_count_blocks(irg)); } @@ -761,7 +761,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name) be_allocate_registers(birg); #ifdef FIRM_STATISTICS - stat_ev_dbl("bemain_costs_before_ra", be_estimate_irg_costs(irg, arch_env, birg->exec_freq)); + stat_ev_dbl("bemain_costs_before_ra", be_estimate_irg_costs(irg, birg->exec_freq)); #endif dump(DUMP_RA, irg, "-ra", dump_ir_block_graph_sched); diff --git a/ir/be/bestat.c b/ir/be/bestat.c index a4f16aa74..4e5a9c520 100644 --- a/ir/be/bestat.c +++ b/ir/be/bestat.c @@ -122,7 +122,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 +139,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; diff --git a/ir/be/bestat.h b/ir/be/bestat.h index afd81d40a..ce1e3f60c 100644 --- a/ir/be/bestat.h +++ b/ir/be/bestat.h @@ -66,8 +66,7 @@ void be_do_stat_reg_pressure(be_irg_t *birg, const arch_register_class_t *cls); * Gives a cost estimate for the program (based on execution frequencies) * and backend op_estimated_cost */ -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); /** * return number of "instructions" (=nodes without some virtual nodes like Proj,