Commit cabe54a4 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Remove the unused attribute const arch_env_t *arch_env from struct...

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]
parent d293b8b0
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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,
......
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