X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbecopyheur3.c;h=d8a452b26c845ee374944805f0ad34a43c466464;hb=80a6158fdd766f42ee6c508a773bc114ff1b61f3;hp=c79f77e11198834d03058819fa51c0174d66ba75;hpb=e492520ea4bf269acd8421c602f7df4b1b6b1004;p=libfirm diff --git a/ir/be/becopyheur3.c b/ir/be/becopyheur3.c index c79f77e11..d8a452b26 100644 --- a/ir/be/becopyheur3.c +++ b/ir/be/becopyheur3.c @@ -31,6 +31,7 @@ #include "irprintf.h" #include "irtools.h" +#include "bemodule.h" #include "beabi.h" #include "benode_t.h" #include "becopyopt.h" @@ -45,8 +46,8 @@ #define DUMP_AFTER 2 #define DUMP_ALL 2 * DUMP_AFTER - 1 -static int dump_flags = 0; -static int dbg_level = 0; +static unsigned dump_flags = 0; +static int dbg_level = 0; #ifdef WITH_LIBCORE static const lc_opt_enum_mask_items_t dump_items[] = { @@ -61,18 +62,23 @@ static lc_opt_enum_mask_var_t dump_var = { }; static const lc_opt_table_entry_t options[] = { - LC_OPT_ENT_ENUM_MASK("dump", "dump ifg before, after or after each cloud", &dump_var), + LC_OPT_ENT_ENUM_MASK("dump", "dump ifg cloud", &dump_var), LC_OPT_ENT_INT ("dbg", "debug level for the Java coalescer", &dbg_level), { NULL } }; -void be_co3_register_options(lc_opt_entry_t *grp) +void be_init_copyheur3(void) { - lc_opt_entry_t *co3_grp = lc_opt_get_grp(grp, "co3"); + lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); + lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra"); + lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal"); + lc_opt_entry_t *co3_grp = lc_opt_get_grp(chordal_grp, "co3"); + lc_opt_add_table(co3_grp, options); } -#endif +BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur3); +#endif static void set_admissible_regs(be_java_coal_t *coal, copy_opt_t *co, ir_node *irn, int t_idx, int *col_map) { @@ -198,7 +204,10 @@ int co_solve_heuristic_java(copy_opt_t *co) if(bitset_is_set(nodes, idx)) { unsigned t_idx = node_map[idx]; unsigned col = inv_col_map[be_java_coal_get_color(coal, t_idx)]; - const arch_register_t *reg = &co->cls->regs[col]; + const arch_register_t *reg; + + assert(col < n_regs); + reg = &co->cls->regs[col]; arch_set_irn_register(co->aenv, n, reg); } }