commit 0f879b9b0245e0b23a11ac65943846d312b3786f
parent a767351bdd80d0ba97599372d9dd9ad571601b2c
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Mon, 17 Aug 2015 21:16:03 -0400
tweak block-border heuristic for reg. allocation
We only allocate a register that has a hint if the
hint register is not used already. In the max example
it gives a better result and it does not seem to affect
the collatz test.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisc/rega.c b/lisc/rega.c
@@ -324,9 +324,10 @@ rega(Fn *fn)
radd(&cur, t, r);
for (x=0; x<2; x++)
for (t=Tmp0; t<fn->ntmp; t++)
- if (x==1 || tmp[t].hint!=-1)
if (BGET(b->out, t))
if (!BGET(cur.b, t))
+ if (x == 1
+ || ((r=tmp[t].hint) != -1 && !BGET(cur.b, r)))
ralloc(&cur, t);
/* process instructions */
end[n] = cur;