summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-11-01 13:55:06 -0500
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-11-01 13:55:06 -0500
commit0679df0b5620c032f4e2a17ab5faa94ff1ea3ce9 (patch)
tree80da8fdd10bd25a30ed199216c13a5e839664307
parent07c46bc6f905f3a70a043d633a7ec4b879f4db15 (diff)
downloadroux-0679df0b5620c032f4e2a17ab5faa94ff1ea3ce9.tar.gz
break Tmp.phi chains at phi nodes
This makes sure the Tmp.phi "chain" is at most
two elements long.  Something smarted could be
possible, but union-find with path compression
is still not exactly what I want.
-rw-r--r--lisc/parse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisc/parse.c b/lisc/parse.c
index 9e047dc..54031e7 100644
--- a/lisc/parse.c
+++ b/lisc/parse.c
@@ -547,7 +547,9 @@ DoOp:
 			arg[i] = parseref();
 			if (req(arg[i], R))
 				err("invalid instruction argument");
-			if (op == -1 && rtype(arg[i]) == RTmp)
+			if (op == -1)
+			if (rtype(arg[i]) == RTmp)
+			if (!tmp[arg[i].val].phi)
 				tmp[arg[i].val].phi = r.val;
 			i++;
 			t = peek();
@@ -570,6 +572,7 @@ DoOp:
 		curi++;
 		return PIns;
 	} else {
+		tmp[r.val].phi = r.val;
 		phi = alloc(sizeof *phi);
 		phi->to = r;
 		phi->wide = w;