X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbechordal_main.c;h=3c1fac6641d1bccd028fa63f76b909e8a91284e2;hb=c1fdf770d4d000dd5cf22daead32369342c5f5d1;hp=44ba24e3dcdecdc84bf3102db894b618ca199e48;hpb=1875c10b56de89669c3d688d943ba1b4b4469e5a;p=libfirm diff --git a/ir/be/bechordal_main.c b/ir/be/bechordal_main.c index 44ba24e3d..3c1fac664 100644 --- a/ir/be/bechordal_main.c +++ b/ir/be/bechordal_main.c @@ -24,9 +24,7 @@ * @date 29.11.2005 * @version $Id$ */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include #include @@ -36,7 +34,6 @@ #include "list.h" #include "bitset.h" #include "iterator.h" -#include "firm_config.h" #include "lc_opts.h" #include "lc_opts_enum.h" @@ -59,7 +56,6 @@ #include "bechordal_t.h" #include "beabi.h" -#include "bejavacoal.h" #include "beutil.h" #include "besched.h" #include "besched_t.h" @@ -79,11 +75,6 @@ #include "bespilloptions.h" #include "belower.h" -#ifdef WITH_ILP -#include "bespillremat.h" -#endif /* WITH_ILP */ - -#include "bejavacoal.h" #include "becopystat.h" #include "becopyopt.h" #include "bessadestr.h" @@ -105,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 }, @@ -176,15 +165,16 @@ static void dump(unsigned mask, ir_graph *irg, } /** - * Checks for every reload if it's user can perform the load on itself. + * Checks for every reload if its user can perform the load on itself. */ -static void memory_operand_walker(ir_node *irn, void *env) { - be_chordal_env_t *cenv = env; - const arch_env_t *aenv = cenv->birg->main_env->arch_env; +static void memory_operand_walker(ir_node *irn, void *env) +{ const ir_edge_t *edge, *ne; ir_node *block; ir_node *spill; + (void)env; + if (! be_is_Reload(irn)) return; @@ -202,7 +192,7 @@ static void memory_operand_walker(ir_node *irn, void *env) { assert(src && "outedges broken!"); if (get_nodes_block(src) == block && arch_possible_memory_operand(src, pos)) { - arch_perform_memory_operand(aenv, src, spill, pos); + arch_perform_memory_operand(src, spill, pos); } } @@ -217,8 +207,9 @@ 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(be_chordal_env_t *chordal_env) { - irg_walk_graph(chordal_env->irg, NULL, memory_operand_walker, chordal_env); +static INLINE void check_for_memory_operands(ir_graph *irg) +{ + irg_walk_graph(irg, NULL, memory_operand_walker, NULL); } @@ -232,7 +223,6 @@ static void pre_spill(post_spill_env_t *pse, const arch_register_class_t *cls) be_chordal_env_t *chordal_env = &pse->cenv; be_irg_t *birg = pse->birg; ir_graph *irg = be_get_birg_irg(birg); - const be_main_env_t *main_env = birg->main_env; pse->cls = cls; chordal_env->cls = cls; @@ -242,7 +232,7 @@ static void pre_spill(post_spill_env_t *pse, const arch_register_class_t *cls) be_assure_liveness(birg); be_liveness_assure_chk(be_get_birg_liveness(birg)); - stat_ev_do(pse->pre_spill_cost = be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq)); + stat_ev_do(pse->pre_spill_cost = be_estimate_irg_costs(irg, birg->exec_freq)); /* put all ignore registers into the ignore register set. */ be_put_ignore_regs(birg, pse->cls, chordal_env->ignore_colors); @@ -261,13 +251,12 @@ static void post_spill(post_spill_env_t *pse, int iteration) { be_chordal_env_t *chordal_env = &pse->cenv; be_irg_t *birg = pse->birg; ir_graph *irg = birg->irg; - const be_main_env_t *main_env = birg->main_env; - int colors_n = arch_register_class_n_regs(chordal_env->cls); + int colors_n = arch_register_class_n_regs(chordal_env->cls); int allocatable_regs = colors_n - be_put_ignore_regs(birg, chordal_env->cls, NULL); /* some special classes contain only ignore regs, no work to be done */ if (allocatable_regs > 0) { - stat_ev_dbl("bechordal_spillcosts", be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq) - pse->pre_spill_cost); + stat_ev_dbl("bechordal_spillcosts", be_estimate_irg_costs(irg, birg->exec_freq) - pse->pre_spill_cost); /* If we have a backend provided spiller, post spill is @@ -275,7 +264,7 @@ static void post_spill(post_spill_env_t *pse, int iteration) { But we only need to fix stack nodes once in this case. */ BE_TIMER_PUSH(t_ra_spill_apply); - check_for_memory_operands(chordal_env); + check_for_memory_operands(irg); if (iteration == 0) { be_abi_fix_stack_nodes(birg->abi); } @@ -362,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);