mirror of
git://c9x.me/qbe.git
synced 2026-04-05 09:59:47 +00:00
Fn::rpo is a vector
Scratching an itch - avoid unnecesary re-allocation in fillrpo() which is called multiple times in the optimisation chain.
This commit is contained in:
parent
327736b3a6
commit
c16f7eafca
5
cfg.c
5
cfg.c
@ -108,7 +108,10 @@ fillrpo(Fn *f)
|
|||||||
b->id = -1u;
|
b->id = -1u;
|
||||||
n = 1 + rporec(f->start, f->nblk-1);
|
n = 1 + rporec(f->start, f->nblk-1);
|
||||||
f->nblk -= n;
|
f->nblk -= n;
|
||||||
f->rpo = alloc(f->nblk * sizeof f->rpo[0]);
|
if (f->rpo)
|
||||||
|
vgrow(&f->rpo, f->nblk);
|
||||||
|
else
|
||||||
|
f->rpo = vnew(f->nblk, sizeof f->rpo[0], PFn);
|
||||||
for (p=&f->start; (b=*p);) {
|
for (p=&f->start; (b=*p);) {
|
||||||
if (b->id == -1u) {
|
if (b->id == -1u) {
|
||||||
edgedel(b, &b->s1);
|
edgedel(b, &b->s1);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user