remove round-robin in ralloc (need preferences)
This commit is contained in:
parent
e1725c0cdd
commit
27f4eae43e
1 changed files with 3 additions and 8 deletions
11
lisc/rega.c
11
lisc/rega.c
|
@ -73,8 +73,7 @@ radd(RMap *m, int t, int r)
|
||||||
static Ref
|
static Ref
|
||||||
ralloc(RMap *m, int t)
|
ralloc(RMap *m, int t)
|
||||||
{
|
{
|
||||||
static int x;
|
int r;
|
||||||
int n, r;
|
|
||||||
|
|
||||||
if (t < Tmp0) {
|
if (t < Tmp0) {
|
||||||
assert(BGET(m->b, RBASE(t)));
|
assert(BGET(m->b, RBASE(t)));
|
||||||
|
@ -86,13 +85,9 @@ ralloc(RMap *m, int t)
|
||||||
} else {
|
} else {
|
||||||
r = tmp[t].hint;
|
r = tmp[t].hint;
|
||||||
if (r == -1 || BGET(m->b, r))
|
if (r == -1 || BGET(m->b, r))
|
||||||
for (n=0;; x=(x+1)%NReg, n++) {
|
for (r=RAX; BGET(m->b, r); r++)
|
||||||
if (n > NReg)
|
if (r+1 == RAX+NReg)
|
||||||
diag("rega: no more regs");
|
diag("rega: no more regs");
|
||||||
r = RAX + x;
|
|
||||||
if (!BGET(m->b, r))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
radd(m, t, r);
|
radd(m, t, r);
|
||||||
if (tmp[t].hint == -1)
|
if (tmp[t].hint == -1)
|
||||||
tmp[t].hint = r;
|
tmp[t].hint = r;
|
||||||
|
|
Loading…
Add table
Reference in a new issue