|
cmd/gc: eliminate redundant &x.Field nil checks
This eliminates ~75% of the nil checks being emitted,
on all architectures. We can do better, but we need
a bit more general support from the compiler, and
I don't want to do that so close to Go 1.2.
What's here is simple but effective and safe.
A few small code generation cleanups were required
to make the analysis consistent on all systems about
which nil checks are omitted, at least in the test.
Fixes issue 6019.
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+510 lines, -11 lines) |
Patch |
 |
M |
src/cmd/5g/ggen.c
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
src/cmd/5g/peep.c
|
View
|
1
|
2 chunks |
+28 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/5g/prog.c
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
src/cmd/5g/reg.c
|
View
|
1
2
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/6g/cgen.c
|
View
|
1
2
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/6g/ggen.c
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
src/cmd/6g/peep.c
|
View
|
1
|
2 chunks |
+28 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/8g/cgen.c
|
View
|
1
2
|
1 chunk |
+28 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/8g/ggen.c
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
src/cmd/8g/peep.c
|
View
|
1
2
|
2 chunks |
+28 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/gc/gen.c
|
View
|
1
2
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/gc/pgen.c
|
View
|
1
2
|
2 chunks |
+6 lines, -2 lines |
0 comments
|
Download
|
 |
M |
src/cmd/gc/popt.h
|
View
|
1
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/gc/popt.c
|
View
|
1
2
|
1 chunk |
+184 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/cmd/gc/walk.c
|
View
|
1
2
|
1 chunk |
+0 lines, -5 lines |
0 comments
|
Download
|
 |
A |
test/nilptr3.go
|
View
|
1
2
|
1 chunk |
+191 lines, -0 lines |
0 comments
|
Download
|
Total messages: 2
|