- chordal_env.opts = &options;
- chordal_env.irg = irg;
- chordal_env.birg = birg;
- FIRM_DBG_REGISTER(chordal_env.dbg, "firm.be.chordal");
-
- obstack_init(&chordal_env.obst);
-
- BE_TIMER_POP(ra_timer.t_prolog);
-
- be_stat_ev("insns_before", count_insns(irg));
-
- /* Perform the following for each register class. */
- for (j = 0, m = arch_isa_get_n_reg_class(isa); j < m; ++j) {
- node_stat_t node_stat;
- double spillcosts = 0;
-
- chordal_env.cls = arch_isa_get_reg_class(isa, j);
- chordal_env.border_heads = pmap_create();
- chordal_env.ignore_colors = bitset_malloc(chordal_env.cls->n_regs);
-
- if(be_stat_ev_is_active()) {
- be_stat_tags[STAT_TAG_CLS] = chordal_env.cls->name;
- be_stat_ev_push(be_stat_tags, STAT_TAG_LAST, be_stat_file);
-
- /* perform some node statistics. */
- node_stats(&chordal_env, &node_stat);
- be_stat_ev("phis_before_spill", node_stat.n_phis);
- }
-
- /* put all ignore registers into the ignore register set. */
- put_ignore_colors(&chordal_env);
-
-#if 0
- BE_TIMER_PUSH(ra_timer.t_live);
- be_liveness_recompute(birg->lv);
- BE_TIMER_POP(ra_timer.t_live);
- dump(BE_CH_DUMP_LIVE, irg, chordal_env.cls, "-live", dump_ir_block_graph_sched);
-#endif
-
- be_pre_spill_prepare_constr(&chordal_env);
- dump(BE_CH_DUMP_CONSTR, irg, chordal_env.cls, "-constr-pre", dump_ir_block_graph_sched);
-
- if(be_stat_ev_is_active()) {
- spillcosts = be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq);
- }
-
- BE_TIMER_PUSH(ra_timer.t_spill);
-
- /* spilling */
- switch(options.spill_method) {
- case BE_CH_SPILL_MORGAN:
- be_spill_morgan(&chordal_env);
- break;
- case BE_CH_SPILL_BELADY:
- be_spill_belady(&chordal_env);
- break;
-#ifdef WITH_ILP
- case BE_CH_SPILL_REMAT:
- be_spill_remat(&chordal_env);
- break;
-#endif /* WITH_ILP */
- default:
- fprintf(stderr, "no valid spiller selected. falling back to belady\n");
- be_spill_belady(&chordal_env);
- }
-
- BE_TIMER_POP(ra_timer.t_spill);
-
- if(be_stat_ev_is_active()) {
- spillcosts = be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq) - spillcosts;
- be_stat_ev_l("spillcosts", (long) spillcosts);