- /* init belady env */
- obstack_init(&bel.ob);
- bel.arch = chordal_env->birg->main_env->arch_env;
- bel.cls = chordal_env->cls;
- bel.n_regs = arch_register_class_n_regs(bel.cls);
- bel.ws = new_workset(&bel.ob, &bel);
- bel.uses = be_begin_uses(chordal_env->irg, chordal_env->birg->main_env->arch_env, bel.cls);
- bel.senv = be_new_spill_env(chordal_env, is_mem_phi, NULL);
- DEBUG_ONLY(be_set_spill_env_dbg_module(bel.senv, dbg);)
- bel.reloads = pset_new_ptr_default();
- bel.copies = pset_new_ptr_default();
-
- DBG((dbg, LEVEL_1, "running on register class: %s\n", bel.cls->name));
-
- /* do the work */
- be_clear_links(chordal_env->irg);
- irg_block_walk_graph(chordal_env->irg, NULL, belady, &bel);
- irg_block_walk_graph(chordal_env->irg, fix_block_borders, NULL, &bel);
- be_insert_spills_reloads(bel.senv, bel.reloads);
- remove_unused_reloads(chordal_env->irg, &bel);
- remove_copies(&bel);