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;
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);
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
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));
}
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);
typedef struct _estimate_irg_costs_env_t {
- const arch_env_t *arch_env;
ir_exec_freq *execfreqs;
double costs;
} estimate_irg_costs_env_t;
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;
* 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,