From 7f9e897cffc09ba3be701150bbf5d732cc533ef7 Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 14 Dec 2016 00:27:19 +0100 Subject: [PATCH] Spillable vregs now get simplified, if possible. --- mach/proto/mcg/pass_registerallocator.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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; -- 2.34.1