uniformize looping on instructions

I am actually not sure if "i-b->ins < b->nins" is the best way,
maybe the comparison with the last instruction is a little more
efficient...  At least it is uniform now.
This commit is contained in:
Quentin Carbonneaux 2015-11-16 17:54:16 -05:00
parent b8c7645746
commit c744281317
3 changed files with 8 additions and 8 deletions

View file

@ -85,7 +85,7 @@ copy(Fn *fn)
for (b=fn->start; b; b=b->link) {
for (p=b->phi; p; p=p->link)
visitphi(p, cp, &w);
for (i=b->ins; i!=&b->ins[b->nins]; i++)
for (i=b->ins; i-b->ins < b->nins; i++)
visitins(i, cp, &w);
}
while ((w1=w)) {
@ -123,7 +123,7 @@ copy(Fn *fn)
}
pp=&p->link;
}
for (i=b->ins; i!=&b->ins[b->nins]; i++) {
for (i=b->ins; i-b->ins < b->nins; i++) {
r = cp[i->to.val];
if (!req(r, i->to)) {
*i = (Ins){.op = ONop};