X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbespill.c;h=04c886064602fbdfe5ff48c6cd720be8ae2109c5;hb=2c2c56e73d75124c542ec97fa6d0df75a43a6536;hp=503db08b20e635e577f0585ac791066bd9c30fac;hpb=d419b3b5cea65d0b9dee503092f256da1773d74f;p=libfirm diff --git a/ir/be/bespill.c b/ir/be/bespill.c index 503db08b2..04c886064 100644 --- a/ir/be/bespill.c +++ b/ir/be/bespill.c @@ -24,9 +24,7 @@ * @date 29.09.2005 * @version $Id$ */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include #include @@ -199,7 +197,7 @@ void be_add_spill(spill_env_t *env, ir_node *to_spill, ir_node *after) spill_t *s; spill_t *last; - assert(! arch_irn_is(env->arch_env, to_spill, dont_spill)); + assert(!arch_irn_is(to_spill, dont_spill)); DB((dbg, LEVEL_1, "Add spill of %+F after %+F\n", to_spill, after)); /* Just for safety make sure that we do not insert the spill in front of a phi */ @@ -265,7 +263,7 @@ void be_add_reload2(spill_env_t *env, ir_node *to_spill, ir_node *before, spill_info_t *info; reloader_t *rel; - assert(! arch_irn_is(env->arch_env, to_spill, dont_spill)); + assert(!arch_irn_is(to_spill, dont_spill)); info = get_spillinfo(env, to_spill); @@ -446,7 +444,7 @@ static void spill_irn(spill_env_t *env, spill_info_t *spillinfo) after = skip_keeps_phis(after); - spill->spill = be_spill(env->arch_env, block, to_spill); + spill->spill = be_spill(block, to_spill); sched_add_after(after, spill->spill); DB((dbg, LEVEL_1, "\t%+F after %+F\n", spill->spill, after)); #ifdef FIRM_STATISTICS @@ -572,7 +570,7 @@ static int is_value_available(spill_env_t *env, const ir_node *arg, /* * Ignore registers are always available */ - if(arch_irn_is(env->arch_env, arg, ignore)) { + if (arch_irn_is(arg, ignore)) { return 1; } @@ -604,13 +602,11 @@ static int is_value_available(spill_env_t *env, const ir_node *arg, /** * Checks whether the node can principally be rematerialized */ -static int is_remat_node(spill_env_t *env, const ir_node *node) +static int is_remat_node(const ir_node *node) { - const arch_env_t *arch_env = env->arch_env; - assert(!be_is_Spill(node)); - if(arch_irn_is(arch_env, node, rematerializable)) + if (arch_irn_is(node, rematerializable)) return 1; return 0; @@ -633,7 +629,7 @@ static int check_remat_conditions_costs(spill_env_t *env, int argremats; int costs = 0; - if(!is_remat_node(env, spilled)) + if (!is_remat_node(spilled)) return REMAT_COST_INFINITE; if(be_is_Reload(spilled)) { @@ -644,7 +640,7 @@ static int check_remat_conditions_costs(spill_env_t *env, if(parentcosts + costs >= env->reload_cost + env->spill_cost) { return REMAT_COST_INFINITE; } - if(arch_irn_is(env->arch_env, spilled, modify_flags)) { + if (arch_irn_is(spilled, modify_flags)) { return REMAT_COST_INFINITE; } @@ -803,7 +799,7 @@ static void determine_spill_costs(spill_env_t *env, spill_info_t *spillinfo) if(spillinfo->spill_costs >= 0) return; - assert(! arch_irn_is(env->arch_env, to_spill, dont_spill)); + assert(!arch_irn_is(to_spill, dont_spill)); assert(!be_is_Reload(to_spill)); /* some backends have virtual noreg/unknown nodes that are not scheduled @@ -839,7 +835,7 @@ static void determine_spill_costs(spill_env_t *env, spill_info_t *spillinfo) spill_t *s; double spills_execfreq; - /* calculate sum of executaion frequencies of individual spills */ + /* calculate sum of execution frequencies of individual spills */ spills_execfreq = 0; s = spillinfo->spills; for( ; s != NULL; s = s->next) { @@ -908,7 +904,6 @@ void make_spill_locations_dominate_irn(spill_env_t *env, ir_node *irn) void be_insert_spills_reloads(spill_env_t *env) { - const arch_env_t *arch_env = env->arch_env; const ir_exec_freq *exec_freq = env->exec_freq; spill_info_t *si; ir_nodeset_iterator_t iter; @@ -1011,7 +1006,7 @@ void be_insert_spills_reloads(spill_env_t *env) /* create a reload, use the first spill for now SSA * reconstruction for memory comes below */ assert(si->spills != NULL); - copy = be_reload(arch_env, si->reload_cls, rld->reloader, mode, + copy = be_reload(si->reload_cls, rld->reloader, mode, si->spills->spill); #ifdef FIRM_STATISTICS env->reload_count++;