*/
static int cmp_spillinfo(const void *x, const void *y, size_t size)
{
- const spill_info_t *xx = x;
- const spill_info_t *yy = y;
+ const spill_info_t *xx = (const spill_info_t*)x;
+ const spill_info_t *yy = (const spill_info_t*)y;
(void) size;
return xx->to_spill != yy->to_spill;
int hash = hash_irn(value);
info.to_spill = value;
- res = set_find(env->spills, &info, sizeof(info), hash);
+ res = (spill_info_t*)set_find(env->spills, &info, sizeof(info), hash);
if (res == NULL) {
info.reloaders = NULL;
info.spills = NULL;
info.spill_costs = -1;
info.reload_cls = NULL;
- res = set_insert(env->spills, &info, sizeof(info), hash);
+ res = (spill_info_t*)set_insert(env->spills, &info, sizeof(info), hash);
}
return res;
* and simply always available. */
if (!sched_is_scheduled(insn)) {
/* override spillinfos or create a new one */
- spillinfo->spills->spill = new_NoMem();
+ ir_graph *irg = get_irn_irg(to_spill);
+ spillinfo->spills->spill = new_r_NoMem(irg);
DB((dbg, LEVEL_1, "don't spill %+F use NoMem\n", to_spill));
return;
}
static int is_value_available(spill_env_t *env, const ir_node *arg,
const ir_node *reloader)
{
- if (is_Unknown(arg) || arg == new_NoMem())
+ if (is_Unknown(arg) || is_NoMem(arg))
return 1;
if (be_is_Spill(skip_Proj_const(arg)))
* predecessor (of a PhiM) but this test might match other things too...
*/
if (!sched_is_scheduled(insn)) {
+ ir_graph *irg = get_irn_irg(to_spill);
/* override spillinfos or create a new one */
spill_t *spill = OALLOC(&env->obst, spill_t);
spill->after = NULL;
spill->next = NULL;
- spill->spill = new_NoMem();
+ spill->spill = new_r_NoMem(irg);
spillinfo->spills = spill;
spillinfo->spill_costs = 0;
}
/* process each spilled node */
- for (si = set_first(env->spills); si; si = set_next(env->spills)) {
+ foreach_set(env->spills, spill_info_t*, si) {
reloader_t *rld;
ir_node *to_spill = si->to_spill;
ir_mode *mode = get_irn_mode(to_spill);