+ /* Get the code generator interface. */
+ cg_if = isa->impl->get_code_generator_if(isa);
+
+ /* get a code generator for this graph. */
+ birg.cg = cg_if->init(file_handle, &birg);
+
+ /* create the code generator and generate code. */
+ prepare_graph(&birg);
+
+ /* some transformations need to be done before abi introduce */
+ arch_code_generator_before_abi(birg.cg);
+
+ /* implement the ABI conventions. */
+ birg.abi = be_abi_introduce(&birg);
+ dump(DUMP_ABI, irg, "-abi", dump_ir_block_graph);
+
+ /* generate code */
+ arch_code_generator_prepare_graph(birg.cg);
+
+ /*
+ * Since the code generator made a lot of new nodes and skipped
+ * a lot of old ones, we should do dead node elimination here.
+ * Note that this requires disabling the edges here.
+ */
+ edges_deactivate(irg);
+ //dead_node_elimination(irg);
+ edges_activate(irg);
+
+ /* Compute loop nesting information (for weighting copies) */
+ construct_cf_backedges(irg);
+
+ dump(DUMP_PREPARED, irg, "-prepared", dump_ir_block_graph);
+
+ /* add Keeps for should_be_different constrained nodes */
+ assure_constraints(&birg);
+ dump(DUMP_PREPARED, irg, "-assured", dump_ir_block_graph);
+
+ /* Schedule the graphs. */
+ arch_code_generator_before_sched(birg.cg);
+ list_sched(env.arch_env, irg);
+
+ /* connect all stack modifying nodes together (see beabi.c) */
+ be_abi_fix_stack_nodes(birg.abi);
+ dump(DUMP_SCHED, irg, "-sched", dump_ir_block_graph_sched);
+
+ /* Verify the schedule */
+ sched_verify_irg(irg);
+
+ /* Do register allocation */
+ arch_code_generator_before_ra(birg.cg);
+ ra->allocate(&birg);
+ dump(DUMP_RA, irg, "-ra", dump_ir_block_graph_sched);
+
+ arch_code_generator_after_ra(birg.cg);
+ be_abi_fix_stack_bias(birg.abi);
+
+ arch_code_generator_done(birg.cg);
+ dump(DUMP_FINAL, irg, "-end", dump_ir_block_graph_sched);
+ be_abi_free(birg.abi);
+
+ free_ir_graph(irg);