summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--spill.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/spill.c b/spill.c
index 0742caa..c1599c0 100644
--- a/spill.c
+++ b/spill.c
@@ -309,7 +309,7 @@ void
 spill(Fn *fn)
 {
 	Blk *b, *s1, *s2, *hd, **bp;
-	int j, l, t, k, s, lvarg[2];
+	int j, l, t, k, lvarg[2];
 	uint n;
 	BSet u[1], v[1], w[1];
 	Ins *i;
@@ -404,11 +404,9 @@ spill(Fn *fn)
 				continue;
 			}
 			bszero(w);
-			s = -1;
 			if (!req(i->to, R)) {
 				assert(rtype(i->to) == RTmp);
 				t = i->to.val;
-				s = tmp[t].slot;
 				if (bshas(v, t))
 					bsclr(v, t);
 				else {
@@ -442,13 +440,6 @@ spill(Fn *fn)
 					bsset(v, t);
 					if (j-- <= 0)
 						bsset(w, t);
-					else if (!lvarg[n]) {
-						/* recycle the slot of
-						 * i->to when possible
-						 */
-						if (tmp[t].slot == -1)
-							tmp[t].slot = s;
-					}
 					break;
 				}
 			bscopy(u, v);
@@ -456,10 +447,7 @@ spill(Fn *fn)
 			for (n=0; n<2; n++)
 				if (rtype(i->arg[n]) == RTmp) {
 					t = i->arg[n].val;
-					if (bshas(v, t)) {
-						if (tmp[t].slot == s)
-							tmp[t].slot = -1;
-					} else {
+					if (!bshas(v, t)) {
 						/* do not reload if the
 						 * argument is dead
 						 */