From a63052427ead9a8c85fa7143f834d05239b25bde Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 14 Oct 2016 23:17:06 +0200 Subject: [PATCH] Factor out the register allocation routines to make them easier to deal with. --- mach/proto/mcg/pass_registerallocator.c | 111 ++++++++++++++---------- 1 file changed, 67 insertions(+), 44 deletions(-) diff --git a/mach/proto/mcg/pass_registerallocator.c b/mach/proto/mcg/pass_registerallocator.c index 6f2cff26a..9068c5958 100644 --- a/mach/proto/mcg/pass_registerallocator.c +++ b/mach/proto/mcg/pass_registerallocator.c @@ -105,6 +105,61 @@ static bool allocatable(struct hreg* hreg, struct vreg* vreg) return (hreg->attrs & c->attrs); } +static struct hreg* find_input_reg(struct vreg* vreg) +{ + int i; + struct hreg* hreg = NULL; + + for (i=0; i %s\n", + c->equals_to->id, hreg->name); pmap_add(current_ins, hreg, c->equals_to); } else { /* This is an ordinary new register. */ - hreg = NULL; - for (i=0; i