+ FILE *f;
+
+ f = be_chordal_open(chordal_env, "std", ".log");
+ chordal_env->ifg = be_ifg_std_new(chordal_env);
+ be_ifg_check_sorted_to_file(chordal_env->ifg, f);
+ fclose(f);
+
+ f = be_chordal_open(chordal_env, "list", ".log");
+ be_ifg_free(chordal_env->ifg);
+ chordal_env->ifg = be_ifg_list_new(chordal_env);
+ be_ifg_check_sorted_to_file(chordal_env->ifg, f);
+ fclose(f);
+
+ f = be_chordal_open(chordal_env, "clique", ".log");
+ be_ifg_free(chordal_env->ifg);
+ chordal_env->ifg = be_ifg_clique_new(chordal_env);
+ be_ifg_check_sorted_to_file(chordal_env->ifg, f);
+ fclose(f);
+
+ f = be_chordal_open(chordal_env, "pointer", ".log");
+ be_ifg_free(chordal_env->ifg);
+ chordal_env->ifg = be_ifg_pointer_new(chordal_env);
+ be_ifg_check_sorted_to_file(chordal_env->ifg, f);
+ fclose(f);
+
+ chordal_env->ifg = NULL;
+};
+
+/**
+ * Checks for every reload if it's user can perform the load on itself.
+ */
+static void memory_operand_walker(ir_node *irn, void *env) {
+ be_chordal_env_t *cenv = env;
+ const arch_env_t *aenv = cenv->birg->main_env->arch_env;
+ const ir_edge_t *edge, *ne;
+ ir_node *block;
+
+ if (! be_is_Reload(irn))
+ return;
+
+ block = get_nodes_block(irn);
+
+ foreach_out_edge_safe(irn, edge, ne) {
+ ir_node *src = get_edge_src_irn(edge);
+ int pos = get_edge_src_pos(edge);
+
+ if (! src)
+ continue;
+
+ if (get_nodes_block(src) == block && arch_possible_memory_operand(aenv, src, pos)) {
+ DBG((cenv->dbg, LEVEL_3, "performing memory operand %+F at %+F\n", irn, src));
+ arch_perform_memory_operand(aenv, src, irn, pos);
+ }
+ }
+
+ /* kill the Reload */
+ if (get_irn_n_edges(irn) == 0) {
+ sched_remove(irn);
+ set_irn_n(irn, 0, new_Bad());
+ set_irn_n(irn, 1, new_Bad());
+ }
+}
+
+/**
+ * Starts a walk for memory operands if supported by the backend.
+ */
+static INLINE void check_for_memory_operands(be_chordal_env_t *chordal_env) {
+ irg_walk_graph(chordal_env->irg, NULL, memory_operand_walker, chordal_env);
+}
+
+/**
+ * Performs chordal register allocation for each register class on given irg.
+ *
+ * @param bi Backend irg object
+ * @return Structure containing timer for the single phases or NULL if no timing requested.
+ */
+static be_ra_timer_t *be_ra_chordal_main(const be_irg_t *bi)
+{
+ const be_main_env_t *main_env = bi->main_env;
+ const arch_isa_t *isa = arch_env_get_isa(main_env->arch_env);
+ ir_graph *irg = bi->irg;
+ be_options_t *main_opts = main_env->options;
+ int splitted = 0;