- n1_reg = arch_get_irn_register(arch_env, n1);
- if (!arch_reg_is_allocatable(arch_env, n1, -1, n1_reg)) {
- DBG((dbg, 0, "Register %s assigned to %+F is not allowed\n", n1_reg->name, n1));
- assert(0 && "Register constraint does not hold");
- }
- for (o = i+1, n2 = nodes[o]; n2; n2 = nodes[++o]) {
- n2_reg = arch_get_irn_register(arch_env, n2);
- if (values_interfere(n1, n2) && n1_reg == n2_reg) {
- DBG((dbg, 0, "Values %+F and %+F interfere and have the same register assigned\n", n1, n2));
- assert(0 && "Interfering values have the same color!");
- }
- }
+static const lc_opt_enum_int_items_t lower_perm_items[] = {
+ { "copy", BE_CH_LOWER_PERM_COPY },
+ { "swap", BE_CH_LOWER_PERM_SWAP },
+ { NULL, 0 }
+};
+
+static const lc_opt_enum_int_items_t lower_perm_stat_items[] = {
+ { NULL, 0 }
+};
+
+static const lc_opt_enum_int_items_t dump_items[] = {
+ { "none", BE_CH_DUMP_NONE },
+ { "spill", BE_CH_DUMP_SPILL },
+ { "live", BE_CH_DUMP_LIVE },
+ { "color", BE_CH_DUMP_COLOR },
+ { "copymin", BE_CH_DUMP_COPYMIN },
+ { "ssadestr", BE_CH_DUMP_SSADESTR },
+ { "tree", BE_CH_DUMP_TREE_INTV },
+ { "constr", BE_CH_DUMP_CONSTR },
+ { "lower", BE_CH_DUMP_LOWER },
+ { "spillslots", BE_CH_DUMP_SPILLSLOTS },
+ { "appel", BE_CH_DUMP_APPEL },
+ { "all", BE_CH_DUMP_ALL },
+ { NULL, 0 }
+};
+
+static const lc_opt_enum_int_items_t be_ch_vrfy_items[] = {
+ { "off", BE_CH_VRFY_OFF },
+ { "warn", BE_CH_VRFY_WARN },
+ { "assert", BE_CH_VRFY_ASSERT },
+ { NULL, 0 }
+};
+
+static lc_opt_enum_int_var_t lower_perm_var = {
+ &options.lower_perm_opt, lower_perm_items
+};
+
+static lc_opt_enum_int_var_t dump_var = {
+ &options.dump_flags, dump_items
+};
+
+static lc_opt_enum_int_var_t be_ch_vrfy_var = {
+ &options.vrfy_option, be_ch_vrfy_items
+};
+
+static char minir_file[256] = "";
+
+static const lc_opt_table_entry_t be_chordal_options[] = {
+ LC_OPT_ENT_ENUM_PTR ("perm", "perm lowering options", &lower_perm_var),
+ LC_OPT_ENT_ENUM_MASK("dump", "select dump phases", &dump_var),
+ LC_OPT_ENT_ENUM_PTR ("verify", "verify options", &be_ch_vrfy_var),
+ LC_OPT_ENT_STR ("minirout", "dump MinIR to file", minir_file, sizeof(minir_file)),
+ LC_OPT_LAST
+};
+
+static be_module_list_entry_t *colorings = NULL;
+static const be_ra_chordal_coloring_t *selected_coloring = NULL;
+
+void be_register_chordal_coloring(const char *name, be_ra_chordal_coloring_t *coloring)
+{
+ if (selected_coloring == NULL)
+ selected_coloring = coloring;
+
+ be_add_module_to_list(&colorings, name, coloring);
+}
+
+static void be_ra_chordal_coloring(be_chordal_env_t *env)
+{
+ assert(selected_coloring != NULL);
+ if (selected_coloring != NULL) {
+ selected_coloring->allocate(env);