X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbespillmorgan.c;h=16f9e60801e55df0caad62686fa0b6997d2a7b3c;hb=80a6158fdd766f42ee6c508a773bc114ff1b61f3;hp=5126d0c31156825ebad0ee8368be79a3b833cbaa;hpb=41aec860c01cf5d3432e3e475d9b9447c47c8d2a;p=libfirm diff --git a/ir/be/bespillmorgan.c b/ir/be/bespillmorgan.c index 5126d0c31..16f9e6080 100644 --- a/ir/be/bespillmorgan.c +++ b/ir/be/bespillmorgan.c @@ -152,10 +152,10 @@ static INLINE int consider_for_spilling(const arch_env_t *env, const arch_regist } /** - * Determine edges going out of a loop (= edges that go to a block that is not inside - * the loop or one of its subloops) + * Determine edges going out of a loop (= edges that go to a block that is not + * inside the loop or one of its subloops) */ -static INLINE void construct_loop_edges(ir_node* block, void* data) { +static INLINE void construct_loop_edges(ir_node *block, void *data) { morgan_env_t *env = data; int n_cfgpreds = get_Block_n_cfgpreds(block); int i; @@ -240,6 +240,7 @@ static void show_nodebitset(ir_graph* irg, const bitset_t* bitset) { static INLINE void init_livethrough_unuseds(block_attr_t *attr, morgan_env_t *env) { const ir_node *block; int i; + be_lv_t *lv = env->cenv->birg->lv; if(attr->livethrough_unused != NULL) return; @@ -249,8 +250,8 @@ static INLINE void init_livethrough_unuseds(block_attr_t *attr, morgan_env_t *en attr->livethrough_unused = bitset_obstack_alloc(&env->obst, get_irg_last_idx(env->irg)); // copy all live-outs into the livethrough_unused set - be_lv_foreach(env->cenv->lv, block, be_lv_state_in | be_lv_state_out, i) { - ir_node *irn = be_lv_get_irn(env->cenv->lv, block, i); + be_lv_foreach(lv, block, be_lv_state_in | be_lv_state_out, i) { + ir_node *irn = be_lv_get_irn(lv, block, i); int node_idx; if(!consider_for_spilling(env->arch, env->cls, irn)) @@ -431,7 +432,7 @@ static void spill_values(morgan_env_t *env, const loop_attr_t *loop_attr, int sp DBG((dbg, DBG_CHOOSE, "Spilling %+F ", to_spill)); for(edge = set_first(loop_attr->out_edges); edge != NULL; edge = set_next(loop_attr->out_edges)) { - be_add_reload_on_edge(env->senv, to_spill, edge->block, edge->pos); + be_add_reload_on_edge(env->senv, to_spill, edge->block, edge->pos, env->cls); } } } @@ -441,8 +442,9 @@ static int reduce_register_pressure_in_block(morgan_env_t *env, const ir_node* b int max_pressure; int loop_unused_spills_needed; pset *live_nodes = pset_new_ptr_default(); + be_lv_t *lv = env->cenv->birg->lv; - be_liveness_end_of_block(env->cenv->lv, env->arch, env->cls, block, live_nodes); + be_liveness_end_of_block(lv, env->arch, env->cls, block, live_nodes); max_pressure = pset_count(live_nodes); DBG((dbg, DBG_LIVE, "Reduce pressure to %d In Block %+F:\n", env->registers_available, block)); @@ -518,8 +520,7 @@ static int reduce_register_pressure_in_loop(morgan_env_t *env, const ir_loop *lo } /* calculate number of spills needed in outer loop and spill - * unused livethrough nodes around this loop - */ + * unused livethrough nodes around this loop */ if(spills_needed > outer_spills_possible) { int spills_to_place; outer_spills_needed = outer_spills_possible;