Sfoglia il codice sorgente

make sure phis are temporaries in rega

In fact, after spilling, a phi
can be a temporary or a slot.

I am now pondering whether this
is a good idea or not because
it causes annoying mem->mem
movs after register allocation.
Quentin Carbonneaux 6 anni fa
parent
commit
bcc90d074e
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      rega.c

+ 2 - 2
rega.c

@@ -562,8 +562,8 @@ rega(Fn *fn)
 		 * predecessor, we have to find the
 		 * predecessor, we have to find the
 		 * corresponding argument */
 		 * corresponding argument */
 		for (p=s->phi; p; p=p->link) {
 		for (p=s->phi; p; p=p->link) {
-			r = rfind(m, p->to.val);
-			if (r == -1)
+			if (rtype(p->to) != RTmp
+			|| (r=rfind(m, p->to.val)) == -1)
 				continue;
 				continue;
 			for (u=0; u<p->narg; u++) {
 			for (u=0; u<p->narg; u++) {
 				b = p->blk[u];
 				b = p->blk[u];