From: David Given Date: Tue, 13 Dec 2016 23:27:19 +0000 (+0100) Subject: Spillable vregs now get simplified, if possible. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=7f9e897cffc09ba3be701150bbf5d732cc533ef7;p=ack.git Spillable vregs now get simplified, if possible. --- diff --git a/mach/proto/mcg/pass_registerallocator.c b/mach/proto/mcg/pass_registerallocator.c index 17cb7ccca..0ebf4cd94 100644 --- a/mach/proto/mcg/pass_registerallocator.c +++ b/mach/proto/mcg/pass_registerallocator.c @@ -1134,19 +1134,24 @@ static bool attempt_to_simplify(void) if (candidate->degree > 5) return false; - tracef('R', "R: simplifying @%d\n", candidate->id); + tracef('R', "R: simplifying @%d with degree %d\n", candidate->id, candidate->degree); + remove_anode_from_graphs(candidate); return true; } -static bool attempt_to_spill(void) +static bool attempt_to_spill_or_simplify(void) { int i; struct anode* candidate = find_lowest_degree(true); if (!candidate) return false; - tracef('R', "R: spilling @%d with degree %d\n", candidate->id, candidate->degree); + if (candidate->degree > 5) + tracef('R', "R: spilling @%d with degree %d\n", candidate->id, candidate->degree); + else + tracef('R', "R: simplifying @%d with degree %d\n", candidate->id, candidate->degree); + remove_anode_from_graphs(candidate); return true; } @@ -1164,7 +1169,7 @@ static void iterate(void) if (attempt_to_simplify()) continue; - if (attempt_to_spill()) + if (attempt_to_spill_or_simplify()) continue; break;