Commit 03cda906 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

spill: Correct remat_count.

Rematerialisations involving multiple nodes and Projs (e.g. Proj->Load) got miscounted.
Now a rematerialization always counts as 1.
parent 0847bca8
...@@ -480,8 +480,6 @@ static ir_node *do_remat(spill_env_t *env, ir_node *spilled, ir_node *reloader) ...@@ -480,8 +480,6 @@ static ir_node *do_remat(spill_env_t *env, ir_node *spilled, ir_node *reloader)
ins[i] = arg; ins[i] = arg;
} else { } else {
ins[i] = do_remat(env, arg, reloader); ins[i] = do_remat(env, arg, reloader);
/* don't count the argument rematerialization as an extra remat */
--env->remat_count;
} }
} }
...@@ -493,10 +491,8 @@ static ir_node *do_remat(spill_env_t *env, ir_node *spilled, ir_node *reloader) ...@@ -493,10 +491,8 @@ static ir_node *do_remat(spill_env_t *env, ir_node *spilled, ir_node *reloader)
DBG((dbg, LEVEL_1, "Insert remat %+F of %+F before reloader %+F\n", res, DBG((dbg, LEVEL_1, "Insert remat %+F of %+F before reloader %+F\n", res,
spilled, reloader)); spilled, reloader));
if (!is_Proj(res)) { if (!is_Proj(res))
sched_add_before(reloader, res); sched_add_before(reloader, res);
++env->remat_count;
}
return res; return res;
} }
...@@ -742,6 +738,7 @@ void be_insert_spills_reloads(spill_env_t *env) ...@@ -742,6 +738,7 @@ void be_insert_spills_reloads(spill_env_t *env)
} else if (be_do_remats && } else if (be_do_remats &&
(force_remat || rld->remat_cost_delta < 0)) { (force_remat || rld->remat_cost_delta < 0)) {
copy = do_remat(env, to_spill, rld->reloader); copy = do_remat(env, to_spill, rld->reloader);
++env->remat_count;
} else { } else {
/* make sure we have a spill */ /* make sure we have a spill */
spill_node(env, si); spill_node(env, si);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment