}
/**
- * 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;
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;
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))
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);
}
}
}
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));
}
/* 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;