#ifdef PLACE_SPILLS
if (!USES_IS_INFINITE(ws->vals[i].time) && !ws->vals[i].spilled) {
ir_node *after_pos = sched_prev(instr);
+ DB((dbg, DBG_DECIDE, "Spill %+F after node %+F\n", val,
+ after_pos));
be_add_spill(senv, val, after_pos);
}
#endif
assert(is_Phi(node));
loc.time = USES_INFINITY;
DB((dbg, DBG_START, " %+F not taken (dead)\n", node));
- if (is_Phi(node)) {
- be_spill_phi(senv, node);
- }
return loc;
}
if (! is_Phi(node))
break;
+ if (!arch_irn_consider_in_reg_alloc(arch_env, cls, node))
+ continue;
if (all_preds_known) {
available = available_in_all_preds(pred_worksets, arity, node, true);
ARR_APP1(loc_t, delayed, loc);
else
ARR_APP1(loc_t, starters, loc);
+ } else {
+ be_spill_phi(senv, node);
}
}
/* so far we only put nodes into the starters list that are used inside
* the loop. If register pressure in the loop is low then we can take some
* values and let them live through the loop */
+ DB((dbg, DBG_START, "Loop pressure %d, taking %d delayed vals\n",
+ pressure, free_slots));
if (free_slots > 0) {
qsort(delayed, ARR_LEN(delayed), sizeof(delayed[0]), loc_compare);
- for (i = 0; i < ARR_LEN(delayed) && i < free_slots; ++i) {
+ for (i = 0; i < ARR_LEN(delayed) && free_slots > 0; ++i) {
int p, arity;
loc_t *loc = & delayed[i];
DB((dbg, DBG_START, " delayed %+F taken\n", loc->node));
ARR_APP1(loc_t, starters, *loc);
loc->node = NULL;
+ --free_slots;
skip_delayed:
;
}