- n1_reg = arch_get_irn_register(arch_env, n1);
- if (!arch_reg_is_allocatable(arch_env, n1, -1, n1_reg)) {
- DBG((dbg, 0, "Register assigned to %+F is not allowed\n", 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!");
- }
+typedef struct _post_spill_env_t {
+ be_chordal_env_t cenv;
+ be_irg_t *birg;
+ const arch_register_class_t *cls;
+ double pre_spill_cost;
+} post_spill_env_t;
+
+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 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_LAST
+};
+
+static void dump(unsigned mask, ir_graph *irg,
+ const arch_register_class_t *cls,
+ const char *suffix,
+ void (*dump_func)(ir_graph *, const char *))
+{
+ if((options.dump_flags & mask) == mask) {
+ if (cls) {
+ char buf[256];
+ snprintf(buf, sizeof(buf), "-%s%s", cls->name, suffix);
+ be_dump(irg, buf, dump_func);