bug in liveout()
Because of the bsclr() call, liveout was not actually making the union correctly. Instead of performing an union, it now fully sets the bitset passed as parameter.
This commit is contained in:
parent
956154e06e
commit
e91a7788e0
2 changed files with 10 additions and 24 deletions
33
lisc/live.c
33
lisc/live.c
|
@ -6,7 +6,7 @@ liveon(BSet *v, Blk *b, Blk *s)
|
|||
Phi *p;
|
||||
uint a;
|
||||
|
||||
bsunion(v, s->in);
|
||||
bscopy(v, s->in);
|
||||
for (p=s->phi; p; p=p->link) {
|
||||
bsclr(v, p->to.val);
|
||||
for (a=0; a<p->narg; a++)
|
||||
|
@ -14,19 +14,6 @@ liveon(BSet *v, Blk *b, Blk *s)
|
|||
if (rtype(p->arg[a]) == RTmp)
|
||||
bsset(v, p->arg[a].val);
|
||||
}
|
||||
return;
|
||||
|
||||
/*
|
||||
v = s->in;
|
||||
for (p=s->phi; p; p=p->link) {
|
||||
BCLR(v, p->to.val);
|
||||
for (a=0; a<p->narg; a++)
|
||||
if (p->blk[a] == b)
|
||||
if (rtype(p->arg[a]) == RTmp)
|
||||
BSET(v, p->arg[a].val);
|
||||
}
|
||||
return v;
|
||||
*/
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -102,15 +89,15 @@ Again:
|
|||
b = f->rpo[n];
|
||||
|
||||
bscopy(u, b->out);
|
||||
if (b->s1)
|
||||
liveon(b->out, b, b->s1);
|
||||
if (b->s2)
|
||||
liveon(b->out, b, b->s2);
|
||||
|
||||
if (bsequal(b->out, u))
|
||||
continue;
|
||||
else
|
||||
chg = 1;
|
||||
if (b->s1) {
|
||||
liveon(v, b, b->s1);
|
||||
bsunion(b->out, v);
|
||||
}
|
||||
if (b->s2) {
|
||||
liveon(v, b, b->s2);
|
||||
bsunion(b->out, v);
|
||||
}
|
||||
chg |= !bsequal(b->out, u);
|
||||
|
||||
memset(phi, 0, f->ntmp * sizeof phi[0]);
|
||||
memset(nlv, 0, sizeof nlv);
|
||||
|
|
|
@ -397,7 +397,6 @@ spill(Fn *fn)
|
|||
} else if (s1) {
|
||||
liveon(v, b, s1);
|
||||
if (s2) {
|
||||
bszero(u);
|
||||
liveon(u, b, s2);
|
||||
bscopy(w, u);
|
||||
bsinter(w, v);
|
||||
|
|
Loading…
Add table
Reference in a new issue