+ chordal_env.obst = &obst;
+ chordal_env.opts = &options;
+ chordal_env.irg = irg;
+ chordal_env.birg = birg;
+ chordal_env.border_heads = NULL;
+ chordal_env.ifg = NULL;
+ chordal_env.ignore_colors = NULL;
+
+ obstack_init(&obst);
+
+ BE_TIMER_POP(ra_timer.t_prolog);
+
+ be_stat_ev("insns_before", count_insns(irg));
+
+ if (! arch_code_generator_has_spiller(birg->cg)) {
+ /* use one of the generic spiller */
+
+ /* Perform the following for each register class. */
+ for (j = 0, m = arch_isa_get_n_reg_class(isa); j < m; ++j) {
+ post_spill_env_t pse;
+
+ memcpy(&pse.cenv, &chordal_env, sizeof(chordal_env));
+ pse.birg = birg;
+ pre_spill(isa, j, &pse);
+
+ BE_TIMER_PUSH(ra_timer.t_spill);
+ be_do_spill(birg, pse.cls);
+ BE_TIMER_POP(ra_timer.t_spill);
+
+ dump(BE_CH_DUMP_SPILL, irg, pse.cls, "-spill", dump_ir_block_graph_sched);
+
+ post_spill(&pse, 0);
+ }
+ } else {
+ post_spill_env_t *pse;
+
+ /* the backend has it's own spiller */
+ m = arch_isa_get_n_reg_class(isa);
+
+ pse = alloca(m * sizeof(pse[0]));
+
+ for (j = 0; j < m; ++j) {
+ memcpy(&pse[j].cenv, &chordal_env, sizeof(chordal_env));
+ pse[j].birg = birg;
+ pre_spill(isa, j, &pse[j]);
+ }
+
+ BE_TIMER_PUSH(ra_timer.t_spill);
+ arch_code_generator_spill(birg->cg, birg);
+ BE_TIMER_POP(ra_timer.t_spill);
+ dump(BE_CH_DUMP_SPILL, irg, NULL, "-spill", dump_ir_block_graph_sched);
+
+ for (j = 0; j < m; ++j) {
+ post_spill(&pse[j], j);
+ }
+ }
+
+ BE_TIMER_PUSH(ra_timer.t_epilog);
+ lower_nodes_after_ra(birg, options.lower_perm_opt & BE_CH_LOWER_PERM_COPY ? 1 : 0);
+ dump(BE_CH_DUMP_LOWER, irg, NULL, "-belower-after-ra", dump_ir_block_graph_sched);
+
+ obstack_free(&obst, NULL);
+ be_invalidate_liveness(birg);