1
0
mirror of https://github.com/golang/go synced 2024-11-12 09:30:25 -07:00

change minimum sethi/ullman number to 1

to distinguish not computed (0) vs trivial (1).

add missing ullmancalc on function args.

R=ken
OCL=18711
CL=18711
This commit is contained in:
Russ Cox 2008-11-06 14:50:58 -08:00
parent ce164403da
commit 0eda21a2fd
5 changed files with 12 additions and 9 deletions

View File

@ -28,7 +28,7 @@ if(newproc == N) {
newproc->sym = pkglookup("newproc", "sys");
newproc->class = PEXTERN;
newproc->addable = 1;
newproc->ullman = 0;
newproc->ullman = 1;
}
if(throwindex == N) {
@ -36,7 +36,7 @@ if(throwindex == N) {
throwindex->sym = pkglookup("throwindex", "sys");
throwindex->class = PEXTERN;
throwindex->addable = 1;
throwindex->ullman = 0;
throwindex->ullman = 1;
}
if(throwreturn == N) {
@ -44,7 +44,7 @@ if(throwreturn == N) {
throwreturn->sym = pkglookup("throwreturn", "sys");
throwreturn->class = PEXTERN;
throwreturn->addable = 1;
throwreturn->ullman = 0;
throwreturn->ullman = 1;
}
if(fn->nbody == N)

View File

@ -1640,7 +1640,7 @@ tempname(Node *n, Type *t)
n->etype = t->etype;
n->class = PAUTO;
n->addable = 1;
n->ullman = 0;
n->ullman = 1;
dowidth(t);
w = t->width;

View File

@ -865,7 +865,7 @@ newname(Sym *s)
n->sym = s;
n->type = T;
n->addable = 1;
n->ullman = 0;
n->ullman = 1;
return n;
}
@ -886,7 +886,7 @@ oldname(Sym *s)
n->sym = s;
n->type = T;
n->addable = 1;
n->ullman = 0;
n->ullman = 1;
}
return n;
}

View File

@ -2048,7 +2048,7 @@ ullmancalc(Node *n)
switch(n->op) {
case OLITERAL:
case ONAME:
ul = 0;
ul = 1;
goto out;
case OCALL:
case OCALLMETH:
@ -2056,10 +2056,10 @@ ullmancalc(Node *n)
ul = UINF;
goto out;
}
ul = 0;
ul = 1;
if(n->left != N)
ul = n->left->ullman;
ur = 0;
ur = 1;
if(n->right != N)
ur = n->right->ullman;
if(ul == ur)

View File

@ -3053,6 +3053,7 @@ loop1:
fatal("reorder1 OLIST");
t++;
ullmancalc(l);
if(l->ullman >= UINF)
c++;
l = listnext(&save);
@ -3072,6 +3073,7 @@ loop2:
r = list(f, r);
return r;
}
ullmancalc(l);
if(l->ullman < UINF) {
r = list(l, r);
goto more;
@ -3123,6 +3125,7 @@ loop1:
if(l->op == OLIST)
fatal("reorder2 OLIST");
ullmancalc(l);
if(l->ullman >= UINF)
c++;
l = listnext(&save);