summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJulian Oppermann <julian.oppermann@student.kit.edu>2011-08-05 13:34:30 +0200
committerMatthias Braun <matthias.braun@kit.edu>2012-07-25 12:56:07 +0200
commit95d07bc1422c9ed334bf98683949ae46a6fe8e74 (patch)
tree0623f697f72e4b1af44b8904cf7e1f5c3eeda0d5
parent9e7fac4c6c338d1a00d43300b564426914ad0b79 (diff)
Adapted spill_phi to list of spills.exceptions
-rw-r--r--ir/be/bestate.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/ir/be/bestate.c b/ir/be/bestate.c
index dcdb516..e2fce4b 100644
--- a/ir/be/bestate.c
+++ b/ir/be/bestate.c
@@ -221,8 +221,6 @@ static void create_reload(minibelady_env_t *env, ir_node *state,
static void spill_phi(minibelady_env_t *env, ir_node *phi)
{
- assert (0 && "This function has not been adapted to lists of spills");
-
ir_graph *irg = get_irn_irg(phi);
ir_node *block = get_nodes_block(phi);
int arity = get_irn_arity(phi);
@@ -248,19 +246,27 @@ static void spill_phi(minibelady_env_t *env, ir_node *phi)
DBG((dbg, LEVEL_2, "\tcreate Phi-M for %+F\n", phi));
/* create a Phi-M */
- spill_info->spills[0] = be_new_Phi(block, arity, phi_in, mode_M, NULL);
- sched_add_after(block, spill_info->spills[0]);
+ ir_node *spill_phi = be_new_Phi(block, arity, phi_in, mode_M, NULL);
+ sched_add_after(block, spill_phi);
if (spill_to_kill != NULL) {
- exchange(spill_to_kill, spill_info->spills[0]);
- sched_remove(spill_to_kill);
+ exchange(spill_to_kill, spill_phi);
+
+ size_t splen = ARR_LEN(spill_info->spills), j;
+ for (j = 0; j < splen; j++)
+ sched_remove(spill_info->spills[j]);
+
+ ARR_SHRINKLEN(spill_info->spills, 0);
}
+ ARR_APP1(ir_node*, spill_info->spills, spill_phi);
+
/* create spills for the phi values */
for (i = 0; i < arity; ++i) {
ir_node *in = get_irn_n(phi, i);
spill_info_t *pred_spill = create_spill(env, in, 1);
- set_irn_n(spill_info->spills[0], i, pred_spill->spills[0]);
+ assert (ARR_LEN(pred_spill) > 0);
+ set_irn_n(spill_phi, i, pred_spill->spills[0]);
}
}