mirror of
git://c9x.me/qbe.git
synced 2026-04-05 09:59:47 +00:00
change the computation of spill costs for phis
I now take the view that a phi is "used" at the end of all the predecessors. (Think that copies are made to phis at the end of all predecessors.)
This commit is contained in:
parent
425a2ed09c
commit
436d0fc07e
6
spill.c
6
spill.c
@ -68,13 +68,11 @@ fillcost(Fn *fn)
|
||||
}
|
||||
for (b=fn->start; b; b=b->link) {
|
||||
for (p=b->phi; p; p=p->link) {
|
||||
/* todo, the cost computation
|
||||
* for p->to is not great... */
|
||||
t = &fn->tmp[p->to.val];
|
||||
tmpuse(p->to, 0, 0, fn);
|
||||
for (a=0; a<p->narg; a++) {
|
||||
n = p->blk[a]->loop;
|
||||
assert(b->npred==p->narg && "wrong cfg");
|
||||
n /= b->npred;
|
||||
t->cost += n;
|
||||
tmpuse(p->arg[a], 1, n, fn);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user