qbe

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

commit 27f4eae43eebb4990bad59c8becdca41d2fb865d
parent e1725c0cdd15d7fea5beefec24759cc15825ead1
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Sun, 16 Aug 2015 12:41:06 -0400

remove round-robin in ralloc (need preferences)

Diffstat:
Mlisc/rega.c | 11+++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/lisc/rega.c b/lisc/rega.c @@ -73,8 +73,7 @@ radd(RMap *m, int t, int r) static Ref ralloc(RMap *m, int t) { - static int x; - int n, r; + int r; if (t < Tmp0) { assert(BGET(m->b, RBASE(t))); @@ -86,13 +85,9 @@ ralloc(RMap *m, int t) } else { r = tmp[t].hint; if (r == -1 || BGET(m->b, r)) - for (n=0;; x=(x+1)%NReg, n++) { - if (n > NReg) + for (r=RAX; BGET(m->b, r); r++) + if (r+1 == RAX+NReg) diag("rega: no more regs"); - r = RAX + x; - if (!BGET(m->b, r)) - break; - } radd(m, t, r); if (tmp[t].hint == -1) tmp[t].hint = r;