qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit bcc90d074e91c8e5d65876225d0b9f2c91c4248d
parent b15a6d47dc666d660c9cb5b7b75337492896902c
Author: Quentin Carbonneaux <quentin@c9x.me>
Date:   Sat,  9 Mar 2019 22:35:09 +0100

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.

Diffstat:
Mrega.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rega.c b/rega.c @@ -562,8 +562,8 @@ rega(Fn *fn) * predecessor, we have to find the * corresponding argument */ 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; for (u=0; u<p->narg; u++) { b = p->blk[u];