summary refs log tree commit diff
path: root/lisc/rega.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-08-17 21:16:03 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:31 -0400
commit0f879b9b0245e0b23a11ac65943846d312b3786f (patch)
treeb765f33931a8d8a9dc158d573b9a29659557b073 /lisc/rega.c
parenta767351bdd80d0ba97599372d9dd9ad571601b2c (diff)
downloadroux-0f879b9b0245e0b23a11ac65943846d312b3786f.tar.gz
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 (limited to 'lisc/rega.c')
-rw-r--r--lisc/rega.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisc/rega.c b/lisc/rega.c
index f571011..6b29546 100644
--- 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;