From: Christian Würdig Date: Wed, 20 Sep 2006 14:56:03 +0000 (+0000) Subject: added scheduling preparation switch X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=be58dc7203dee8aa843da102d665a06e1a995c14;p=libfirm added scheduling preparation switch added rss scheduling preparation --- diff --git a/ir/be/be_t.h b/ir/be/be_t.h index 930239e61..b9f6ee924 100644 --- a/ir/be/be_t.h +++ b/ir/be/be_t.h @@ -46,11 +46,18 @@ enum { BE_SCHED_SELECT_RANDOM = 5 }; +enum { + BE_SCHED_PREP_NONE = 0, + BE_SCHED_PREP_MRIS = 2, + BE_SCHED_PREP_RSS = 3 +}; + /** Backend options */ struct _be_options_t { int dump_flags; /**< backend dumping flags */ int timing; /**< time the backend phases */ int sched_select; /**< the current scheduler */ + int sched_prep; int opt_profile; /**< instrument code for profiling */ int mris; /**< enable mris preparation */ int omit_fp; /**< try to omit the frame pointer */ diff --git a/ir/be/belistsched.c b/ir/be/belistsched.c index dfaaad37b..937ff5a88 100644 --- a/ir/be/belistsched.c +++ b/ir/be/belistsched.c @@ -482,8 +482,8 @@ static void list_sched_block(ir_node *block, void *env_ptr) /* List schedule a graph. */ void list_sched(const be_irg_t *birg, be_options_t *be_opts) { - const arch_env_t *arch_env = birg->main_env->arch_env; - ir_graph *irg = birg->irg; + const arch_env_t *arch_env = birg->main_env->arch_env; + ir_graph *irg = birg->irg; int num_nodes; sched_env_t env; @@ -515,8 +515,16 @@ void list_sched(const be_irg_t *birg, be_options_t *be_opts) /* Assure, that the out edges are computed */ edges_assure(irg); - if (be_opts->mris) - mris = be_sched_mris_preprocess(birg); + switch (be_opts->sched_prep) { + case BE_SCHED_PREP_MRIS: + mris = be_sched_mris_preprocess(birg); + break; + case BE_SCHED_PREP_RSS: + rss_schedule_preparation(birg); + break; + default: + break; + } num_nodes = get_irg_last_idx(irg); @@ -538,7 +546,7 @@ void list_sched(const be_irg_t *birg, be_options_t *be_opts) if (env.selector->finish_graph) env.selector->finish_graph(env.selector_env); - if (be_opts->mris) + if (be_opts->sched_prep == BE_SCHED_PREP_MRIS) be_sched_mris_free(mris); DEL_ARR_F(env.sched_info); diff --git a/ir/be/bemain.c b/ir/be/bemain.c index 4b8c83325..1fee7453d 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -72,6 +72,7 @@ static be_options_t be_options = { DUMP_NONE, /* dump flags */ BE_TIME_OFF, /* no timing */ BE_SCHED_SELECT_HEUR, /* mueller heuristic selector */ + BE_SCHED_PREP_NONE, /* no scheduling preparation */ 0, /* no opt profile */ 0, /* disable mris */ 1, /* try to omit frame pointer */ @@ -145,6 +146,14 @@ static const lc_opt_enum_int_items_t sched_select_items[] = { { NULL, 0 } }; +/* schedule preparation options. */ +static const lc_opt_enum_int_items_t sched_prep_items[] = { + { "none", BE_SCHED_PREP_NONE }, + { "mris", BE_SCHED_PREP_MRIS }, + { "rss", BE_SCHED_PREP_RSS }, + { NULL, 0 } +}; + static lc_opt_enum_mask_var_t dump_var = { &be_options.dump_flags, dump_items }; @@ -165,6 +174,10 @@ static lc_opt_enum_int_var_t sched_select_var = { &be_options.sched_select, sched_select_items }; +static lc_opt_enum_int_var_t sched_prep_var = { + &be_options.sched_prep, sched_prep_items +}; + static const lc_opt_table_entry_t be_main_options[] = { LC_OPT_ENT_STR ("config", "read another config file containing backend options", config_file, sizeof(config_file)), LC_OPT_ENT_ENUM_MASK("dump", "dump irg on several occasions", &dump_var), @@ -175,7 +188,7 @@ static const lc_opt_table_entry_t be_main_options[] = { LC_OPT_ENT_ENUM_PTR ("vrfy", "verify the backend irg (off, warn, assert)", &vrfy_var), LC_OPT_ENT_BOOL ("time", "get backend timing statistics", &be_options.timing), LC_OPT_ENT_BOOL ("profile", "instrument the code for execution count profiling", &be_options.opt_profile), - LC_OPT_ENT_BOOL ("sched.mris", "enable mris schedule preparation", &be_options.mris), + LC_OPT_ENT_ENUM_PTR ("sched.prep", "schedule preparation (none, mris, rss)", &sched_prep_var), LC_OPT_ENT_ENUM_PTR ("sched.select", "schedule node selector (trivial, regpress, muchnik, heur, hmuchnik)", &sched_select_var), #ifdef WITH_ILP