From: Christian Würdig Date: Mon, 3 Apr 2006 09:28:06 +0000 (+0000) Subject: register options for cmdline X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=d21205a7860d7b8a9e7370f45f9e065c77e3c611;p=libfirm register options for cmdline --- diff --git a/ir/be/bechordal_main.c b/ir/be/bechordal_main.c index c4fff678b..a5b0cd8c9 100644 --- a/ir/be/bechordal_main.c +++ b/ir/be/bechordal_main.c @@ -161,7 +161,7 @@ static be_ra_chordal_opts_t options = { BE_CH_SPILL_BELADY, BE_CH_COPYMIN_HEUR, BE_CH_IFG_STD, - BE_CH_LOWER_PERM_SWAP + BE_CH_LOWER_PERM_SWAP | BE_CH_LOWER_PERM_STAT, }; #ifdef WITH_LIBCORE @@ -188,8 +188,13 @@ static const lc_opt_enum_int_items_t ifg_flavor_items[] = { }; static const lc_opt_enum_int_items_t lower_perm_items[] = { - { "swap", BE_CH_LOWER_PERM_SWAP }, { "copy", BE_CH_LOWER_PERM_COPY }, + { "swap", BE_CH_LOWER_PERM_SWAP }, + { "stat", BE_CH_LOWER_PERM_STAT }, + { NULL, 0 } +}; + +static const lc_opt_enum_int_items_t lower_perm_stat_items[] = { { NULL, 0 } }; @@ -218,16 +223,34 @@ static lc_opt_enum_int_var_t ifg_flavor_var = { }; static lc_opt_enum_int_var_t lower_perm_var = { - &options.lower_perm_method, lower_perm_items + &options.lower_perm_opt, lower_perm_items }; static lc_opt_enum_int_var_t dump_var = { &options.dump_flags, dump_items }; +static const lc_opt_table_entry_t be_chordal_options[] = { + LC_OPT_ENT_ENUM_MASK("spill", "spill method (belady or ilp)", &spill_var), + LC_OPT_ENT_ENUM_PTR("copymin", "copymin method (heur or ilp)", ©min_var), + LC_OPT_ENT_ENUM_PTR("ifg", "interference graph flavour (std or fast)", &ifg_flavor_var), + LC_OPT_ENT_ENUM_MASK("lowerperm", "perm lowering options (copy, swap, stat)", &lower_perm_var), + LC_OPT_ENT_ENUM_MASK("dump", "select dump phases", &dump_var), + { NULL } +}; + static void be_ra_chordal_register_options(lc_opt_entry_t *grp) { - grp = lc_opt_get_grp(grp, "chordal"); + int i; + static int run_once = 0; + lc_opt_entry_t *chordal_grp; + + if (! run_once) { + run_once = 1; + chordal_grp = lc_opt_get_grp(grp, "chordal"); + + lc_opt_add_table(chordal_grp, be_chordal_options); + } } #endif @@ -332,7 +355,9 @@ static void be_ra_chordal_main(const be_irg_t *bi) dump(BE_CH_DUMP_LOWER, irg, NULL, "-spilloff", dump_ir_block_graph_sched); - lower_nodes_after_ra(&chordal_env, options.lower_perm_method == BE_CH_LOWER_PERM_COPY ? 1 : 0, 1); + lower_nodes_after_ra(&chordal_env, + options.lower_perm_opt & BE_CH_LOWER_PERM_COPY, + options.lower_perm_opt & BE_CH_LOWER_PERM_STAT); dump(BE_CH_DUMP_LOWER, irg, NULL, "-belower-after-ra", dump_ir_block_graph_sched); obstack_free(&chordal_env.obst, NULL); diff --git a/ir/be/bechordal_t.h b/ir/be/bechordal_t.h index dbf7e8dc5..206c5aca0 100644 --- a/ir/be/bechordal_t.h +++ b/ir/be/bechordal_t.h @@ -112,9 +112,10 @@ enum { BE_CH_IFG_STD = 1, BE_CH_IFG_FAST = 2, - /* lower perm method */ - BE_CH_LOWER_PERM_SWAP = 1, - BE_CH_LOWER_PERM_COPY = 2 + /* lower perm options */ + BE_CH_LOWER_PERM_SWAP = (1 << 0), + BE_CH_LOWER_PERM_COPY = (1 << 1), + BE_CH_LOWER_PERM_STAT = (1 << 2) }; struct _be_ra_chordal_opts_t { @@ -122,7 +123,7 @@ struct _be_ra_chordal_opts_t { int spill_method; int copymin_method; int ifg_flavor; - int lower_perm_method; + int lower_perm_opt; char ilp_server[128]; char ilp_solver[128];