X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbechordal_main.c;h=1a395c90e34fd8fd74d48ab709d910bfa046869e;hb=2428e8c0513d2b96a64dfa072e8cd1b861d62b8e;hp=c81b3bd445747f83dee4afc5bdb3d6721fec3ce8;hpb=cabe54a4c9fe9bcd6e66a221fde914c7e16e274f;p=libfirm diff --git a/ir/be/bechordal_main.c b/ir/be/bechordal_main.c index c81b3bd44..1a395c90e 100644 --- a/ir/be/bechordal_main.c +++ b/ir/be/bechordal_main.c @@ -96,8 +96,6 @@ typedef struct _post_spill_env_t { double pre_spill_cost; } post_spill_env_t; -static be_options_t *main_opts; - static const lc_opt_enum_int_items_t lower_perm_items[] = { { "copy", BE_CH_LOWER_PERM_COPY }, { "swap", BE_CH_LOWER_PERM_SWAP }, @@ -146,7 +144,7 @@ static lc_opt_enum_int_var_t be_ch_vrfy_var = { 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 ("vrfy", "verify options", &be_ch_vrfy_var), + LC_OPT_ENT_ENUM_PTR ("verify", "verify options", &be_ch_vrfy_var), LC_OPT_LAST }; @@ -209,7 +207,7 @@ static void memory_operand_walker(ir_node *irn, void *env) /** * Starts a walk for memory operands if supported by the backend. */ -static INLINE void check_for_memory_operands(ir_graph *irg) +static inline void check_for_memory_operands(ir_graph *irg) { irg_walk_graph(irg, NULL, memory_operand_walker, NULL); } @@ -272,9 +270,9 @@ static void post_spill(post_spill_env_t *pse, int iteration) { } BE_TIMER_POP(t_ra_spill_apply); - BE_TIMER_PUSH(t_verify); /* verify schedule and register pressure */ + BE_TIMER_PUSH(t_verify); if (chordal_env->opts->vrfy_option == BE_CH_VRFY_WARN) { be_verify_schedule(birg); be_verify_register_pressure(birg, pse->cls, irg); @@ -353,14 +351,12 @@ static void post_spill(post_spill_env_t *pse, int iteration) { */ static void be_ra_chordal_main(be_irg_t *birg) { - const be_main_env_t *main_env = birg->main_env; - const arch_env_t *arch_env = main_env->arch_env; - ir_graph *irg = birg->irg; - int j, m; - be_chordal_env_t chordal_env; - struct obstack obst; - - main_opts = main_env->options; + const arch_env_t *arch_env = birg->main_env->arch_env; + ir_graph *irg = birg->irg; + int j; + int m; + be_chordal_env_t chordal_env; + struct obstack obst; BE_TIMER_PUSH(t_ra_other); @@ -452,7 +448,12 @@ static void be_ra_chordal_main(be_irg_t *birg) } BE_TIMER_PUSH(t_verify); - be_verify_register_allocation(birg); + if (chordal_env.opts->vrfy_option == BE_CH_VRFY_WARN) { + be_verify_register_allocation(birg); + } else if(chordal_env.opts->vrfy_option == BE_CH_VRFY_ASSERT) { + assert(be_verify_register_allocation(birg) + && "Register allocation invalid"); + } BE_TIMER_POP(t_verify); BE_TIMER_PUSH(t_ra_epilog);