mirror of
https://github.com/golang/go
synced 2024-11-25 08:47:56 -07:00
sped up optimization by not optimizing
very large functions. R=r OCL=34080 CL=34080
This commit is contained in:
parent
22c2b476a8
commit
bc15b94181
@ -1175,8 +1175,12 @@ yes:
|
||||
}
|
||||
|
||||
static int
|
||||
regcmp(Node *ra, Node *rb)
|
||||
regcmp(const void *va, const void *vb)
|
||||
{
|
||||
Node *ra, *rb;
|
||||
|
||||
ra = (Node*)va;
|
||||
rb = (Node*)vb;
|
||||
return ra->local - rb->local;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,8 @@ void paint1(Reg*, int);
|
||||
uint32 paint2(Reg*, int);
|
||||
void paint3(Reg*, int, int32, int);
|
||||
void addreg(Adr*, int);
|
||||
void dumpit(char *str, Reg *r0);
|
||||
void dumpone(Reg*);
|
||||
void dumpit(char*, Reg*);
|
||||
int noreturn(Prog *p);
|
||||
|
||||
/*
|
||||
|
@ -106,6 +106,16 @@ regopt(Prog *firstp)
|
||||
first = 0;
|
||||
}
|
||||
|
||||
// count instructions
|
||||
nr = 0;
|
||||
for(p=firstp; p!=P; p=p->link)
|
||||
nr++;
|
||||
// if too big dont bother
|
||||
if(nr >= 10000) {
|
||||
print("********** %S is too big (%d)\n", curfn->nname->sym, nr);
|
||||
return;
|
||||
}
|
||||
|
||||
r1 = R;
|
||||
firstr = R;
|
||||
lastr = R;
|
||||
@ -1464,14 +1474,11 @@ BtoF(int32 b)
|
||||
}
|
||||
|
||||
void
|
||||
dumpit(char *str, Reg *r0)
|
||||
dumpone(Reg *r)
|
||||
{
|
||||
Reg *r, *r1;
|
||||
int z;
|
||||
Bits bit;
|
||||
|
||||
print("\n%s\n", str);
|
||||
for(r = r0; r != R; r = r->link) {
|
||||
print("%ld:%P", r->loop, r->prog);
|
||||
for(z=0; z<BITS; z++)
|
||||
bit.b[z] =
|
||||
@ -1507,6 +1514,16 @@ dumpit(char *str, Reg *r0)
|
||||
print(" a:%Q ", r->act);
|
||||
}
|
||||
print("\n");
|
||||
}
|
||||
|
||||
void
|
||||
dumpit(char *str, Reg *r0)
|
||||
{
|
||||
Reg *r, *r1;
|
||||
|
||||
print("\n%s\n", str);
|
||||
for(r = r0; r != R; r = r->link) {
|
||||
dumpone(r);
|
||||
r1 = r->p2;
|
||||
if(r1 != R) {
|
||||
print(" pred:");
|
||||
@ -1535,6 +1552,7 @@ noreturn(Prog *p)
|
||||
if(symlist[0] == S) {
|
||||
symlist[0] = pkglookup("throwindex", "sys");
|
||||
symlist[0] = pkglookup("throwslice", "sys");
|
||||
symlist[0] = pkglookup("throwinit", "sys");
|
||||
symlist[1] = pkglookup("panicl", "sys");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user