Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
bc15b941
Commit
bc15b941
authored
Aug 29, 2009
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sped up optimization by not optimizing
very large functions. R=r OCL=34080 CL=34080
parent
22c2b476
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
39 deletions
+62
-39
src/cmd/6g/ggen.c
src/cmd/6g/ggen.c
+5
-1
src/cmd/6g/opt.h
src/cmd/6g/opt.h
+2
-1
src/cmd/6g/reg.c
src/cmd/6g/reg.c
+55
-37
No files found.
src/cmd/6g/ggen.c
View file @
bc15b941
...
@@ -1175,8 +1175,12 @@ yes:
...
@@ -1175,8 +1175,12 @@ yes:
}
}
static
int
static
int
regcmp
(
Node
*
ra
,
Node
*
r
b
)
regcmp
(
const
void
*
va
,
const
void
*
v
b
)
{
{
Node
*
ra
,
*
rb
;
ra
=
(
Node
*
)
va
;
rb
=
(
Node
*
)
vb
;
return
ra
->
local
-
rb
->
local
;
return
ra
->
local
-
rb
->
local
;
}
}
...
...
src/cmd/6g/opt.h
View file @
bc15b941
...
@@ -137,7 +137,8 @@ void paint1(Reg*, int);
...
@@ -137,7 +137,8 @@ void paint1(Reg*, int);
uint32
paint2
(
Reg
*
,
int
);
uint32
paint2
(
Reg
*
,
int
);
void
paint3
(
Reg
*
,
int
,
int32
,
int
);
void
paint3
(
Reg
*
,
int
,
int32
,
int
);
void
addreg
(
Adr
*
,
int
);
void
addreg
(
Adr
*
,
int
);
void
dumpit
(
char
*
str
,
Reg
*
r0
);
void
dumpone
(
Reg
*
);
void
dumpit
(
char
*
,
Reg
*
);
int
noreturn
(
Prog
*
p
);
int
noreturn
(
Prog
*
p
);
/*
/*
...
...
src/cmd/6g/reg.c
View file @
bc15b941
...
@@ -106,6 +106,16 @@ regopt(Prog *firstp)
...
@@ -106,6 +106,16 @@ regopt(Prog *firstp)
first
=
0
;
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
;
r1
=
R
;
firstr
=
R
;
firstr
=
R
;
lastr
=
R
;
lastr
=
R
;
...
@@ -1464,49 +1474,56 @@ BtoF(int32 b)
...
@@ -1464,49 +1474,56 @@ BtoF(int32 b)
}
}
void
void
dump
it
(
char
*
str
,
Reg
*
r0
)
dump
one
(
Reg
*
r
)
{
{
Reg
*
r
,
*
r1
;
int
z
;
int
z
;
Bits
bit
;
Bits
bit
;
print
(
"%ld:%P"
,
r
->
loop
,
r
->
prog
);
for
(
z
=
0
;
z
<
BITS
;
z
++
)
bit
.
b
[
z
]
=
r
->
set
.
b
[
z
]
|
r
->
use1
.
b
[
z
]
|
r
->
use2
.
b
[
z
]
|
r
->
refbehind
.
b
[
z
]
|
r
->
refahead
.
b
[
z
]
|
r
->
calbehind
.
b
[
z
]
|
r
->
calahead
.
b
[
z
]
|
r
->
regdiff
.
b
[
z
]
|
r
->
act
.
b
[
z
]
|
0
;
if
(
bany
(
&
bit
))
{
print
(
"
\t
"
);
if
(
bany
(
&
r
->
set
))
print
(
" s:%Q"
,
r
->
set
);
if
(
bany
(
&
r
->
use1
))
print
(
" u1:%Q"
,
r
->
use1
);
if
(
bany
(
&
r
->
use2
))
print
(
" u2:%Q"
,
r
->
use2
);
if
(
bany
(
&
r
->
refbehind
))
print
(
" rb:%Q "
,
r
->
refbehind
);
if
(
bany
(
&
r
->
refahead
))
print
(
" ra:%Q "
,
r
->
refahead
);
if
(
bany
(
&
r
->
calbehind
))
print
(
"cb:%Q "
,
r
->
calbehind
);
if
(
bany
(
&
r
->
calahead
))
print
(
" ca:%Q "
,
r
->
calahead
);
if
(
bany
(
&
r
->
regdiff
))
print
(
" d:%Q "
,
r
->
regdiff
);
if
(
bany
(
&
r
->
act
))
print
(
" a:%Q "
,
r
->
act
);
}
print
(
"
\n
"
);
}
void
dumpit
(
char
*
str
,
Reg
*
r0
)
{
Reg
*
r
,
*
r1
;
print
(
"
\n
%s
\n
"
,
str
);
print
(
"
\n
%s
\n
"
,
str
);
for
(
r
=
r0
;
r
!=
R
;
r
=
r
->
link
)
{
for
(
r
=
r0
;
r
!=
R
;
r
=
r
->
link
)
{
print
(
"%ld:%P"
,
r
->
loop
,
r
->
prog
);
dumpone
(
r
);
for
(
z
=
0
;
z
<
BITS
;
z
++
)
bit
.
b
[
z
]
=
r
->
set
.
b
[
z
]
|
r
->
use1
.
b
[
z
]
|
r
->
use2
.
b
[
z
]
|
r
->
refbehind
.
b
[
z
]
|
r
->
refahead
.
b
[
z
]
|
r
->
calbehind
.
b
[
z
]
|
r
->
calahead
.
b
[
z
]
|
r
->
regdiff
.
b
[
z
]
|
r
->
act
.
b
[
z
]
|
0
;
if
(
bany
(
&
bit
))
{
print
(
"
\t
"
);
if
(
bany
(
&
r
->
set
))
print
(
" s:%Q"
,
r
->
set
);
if
(
bany
(
&
r
->
use1
))
print
(
" u1:%Q"
,
r
->
use1
);
if
(
bany
(
&
r
->
use2
))
print
(
" u2:%Q"
,
r
->
use2
);
if
(
bany
(
&
r
->
refbehind
))
print
(
" rb:%Q "
,
r
->
refbehind
);
if
(
bany
(
&
r
->
refahead
))
print
(
" ra:%Q "
,
r
->
refahead
);
if
(
bany
(
&
r
->
calbehind
))
print
(
"cb:%Q "
,
r
->
calbehind
);
if
(
bany
(
&
r
->
calahead
))
print
(
" ca:%Q "
,
r
->
calahead
);
if
(
bany
(
&
r
->
regdiff
))
print
(
" d:%Q "
,
r
->
regdiff
);
if
(
bany
(
&
r
->
act
))
print
(
" a:%Q "
,
r
->
act
);
}
print
(
"
\n
"
);
r1
=
r
->
p2
;
r1
=
r
->
p2
;
if
(
r1
!=
R
)
{
if
(
r1
!=
R
)
{
print
(
" pred:"
);
print
(
" pred:"
);
...
@@ -1535,6 +1552,7 @@ noreturn(Prog *p)
...
@@ -1535,6 +1552,7 @@ noreturn(Prog *p)
if
(
symlist
[
0
]
==
S
)
{
if
(
symlist
[
0
]
==
S
)
{
symlist
[
0
]
=
pkglookup
(
"throwindex"
,
"sys"
);
symlist
[
0
]
=
pkglookup
(
"throwindex"
,
"sys"
);
symlist
[
0
]
=
pkglookup
(
"throwslice"
,
"sys"
);
symlist
[
0
]
=
pkglookup
(
"throwslice"
,
"sys"
);
symlist
[
0
]
=
pkglookup
(
"throwinit"
,
"sys"
);
symlist
[
1
]
=
pkglookup
(
"panicl"
,
"sys"
);
symlist
[
1
]
=
pkglookup
(
"panicl"
,
"sys"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment