From 4d1c91fe7467961480cd0a04f6cf2acd7c6ea3b6 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 2 Sep 2008 11:35:55 +0000 Subject: [PATCH] fix too conservative delay taking step [r21643] --- ir/be/bespillbelady.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ir/be/bespillbelady.c b/ir/be/bespillbelady.c index 9b3a72b8a..203edf2ef 100644 --- a/ir/be/bespillbelady.c +++ b/ir/be/bespillbelady.c @@ -627,10 +627,12 @@ static void decide_start_workset(const ir_node *block) /* 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]; @@ -655,6 +657,7 @@ static void decide_start_workset(const ir_node *block) DB((dbg, DBG_START, " delayed %+F taken\n", loc->node)); ARR_APP1(loc_t, starters, *loc); loc->node = NULL; + --free_slots; skip_delayed: ; } -- 2.20.1