go/src
Josh Bleecher Snyder 8607b2e825 cmd/compile: optimize A->B->C Moves that include VarDefs
We have an existing optimization that recognizes
memory moves of the form A -> B -> C and converts
them into A -> C, in the hopes that the store to
B will be end up being dead and thus eliminated.

However, when A, B, and C are large types,
the front end sometimes emits VarDef ops for the moves.
This change adds an optimization to match that pattern.

This required changing an old compiler test.
The test assumed that a temporary was required
to deal with a large return value.
With this optimization in place, that temporary
ended up being eliminated.

Triggers 649 times during 'go build -a std cmd'.

Cuts 16k off cmd/go.

name        old object-bytes  new object-bytes  delta
Template          507kB ± 0%        507kB ± 0%  -0.15%  (p=0.008 n=5+5)
Unicode           225kB ± 0%        225kB ± 0%    ~     (all equal)
GoTypes          1.85MB ± 0%       1.85MB ± 0%    ~     (all equal)
Flate             328kB ± 0%        328kB ± 0%    ~     (all equal)
GoParser          402kB ± 0%        402kB ± 0%  -0.00%  (p=0.008 n=5+5)
Reflect          1.41MB ± 0%       1.41MB ± 0%  -0.20%  (p=0.008 n=5+5)
Tar               458kB ± 0%        458kB ± 0%    ~     (all equal)
XML               601kB ± 0%        599kB ± 0%  -0.21%  (p=0.008 n=5+5)

Change-Id: I9b5f25c8663a0b772ad1ee51fa61f74b74d26dd3
Reviewed-on: https://go-review.googlesource.com/c/143479
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Munday <mike.munday@ibm.com>
2018-11-11 14:18:33 +00:00
..
archive all: fix a bunch of misspellings 2018-10-08 03:12:03 +00:00
bufio bufio: fix indexes in TestWriter 2018-11-09 19:15:11 +00:00
builtin
bytes strings,bytes: use inlineable function trampolines instead of linkname 2018-11-08 20:52:47 +00:00
cmd cmd/compile: optimize A->B->C Moves that include VarDefs 2018-11-11 14:18:33 +00:00
compress all: fix a bunch of misspellings 2018-10-06 15:40:03 +00:00
container container/list: combining insert and remove operations while moving elements within a list. 2018-10-26 20:47:01 +00:00
context context: avoid duplicate removeChild 2018-10-03 15:26:10 +00:00
crypto crypto/md5: fix md5block asm to work on big endian ppc64 2018-11-09 15:54:21 +00:00
database/sql database/sql: add support for returning cursors to client 2018-11-08 21:19:17 +00:00
debug all: skip unsupported tests on AIX 2018-11-02 16:12:08 +00:00
encoding all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
errors
expvar expvar: add Map.Delete 2018-10-04 01:16:52 +00:00
flag flag: return a consistent parse error if the flag value is invalid 2018-10-19 03:48:38 +00:00
fmt fmt: print maps in key-sorted order 2018-10-18 21:12:24 +00:00
go go/build, go/doc: fix tautological conditions 2018-11-11 01:02:11 +00:00
hash hash/crc64: use t.Fatalf in TestGolden 2018-10-25 06:32:12 +00:00
html all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
image jpeg: simplify 'x = x op ...' to 'x op= ...' 2018-10-13 11:18:56 +00:00
index/suffixarray
internal strings,bytes: use inlineable function trampolines instead of linkname 2018-11-08 20:52:47 +00:00
io io: export StringWriter 2018-10-03 20:13:35 +00:00
log log: add Logger.Writer method 2018-10-25 23:23:57 +00:00
math all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
mime mime/multipart: check for quoted-printable case insensitively 2018-11-09 05:37:10 +00:00
net all: add support for synchronous callbacks to js/wasm 2018-11-10 11:57:17 +00:00
os Revert "os: remove sleep in windows Process.Wait" 2018-11-09 23:24:35 +00:00
path all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
plugin
reflect reflect: fix StructOf panics from too many methods in embedded fields 2018-11-06 13:52:29 +00:00
regexp all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
runtime runtime: ensure m.p is never stale 2018-11-10 19:26:41 +00:00
sort
strconv strconv: add comment explaining bounded shift in formatBits 2018-10-15 21:45:52 +00:00
strings strings,bytes: use inlineable function trampolines instead of linkname 2018-11-08 20:52:47 +00:00
sync all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
syscall all: add support for synchronous callbacks to js/wasm 2018-11-10 11:57:17 +00:00
testdata Revert "compress: move benchmark text from src/testdata to src/compress/testdata" 2018-10-01 16:16:21 +00:00
testing testing: implement -benchtime=100x 2018-10-12 17:48:31 +00:00
text text/template/parse: simplify Tree.pipeline 2018-10-29 12:20:11 +00:00
time time: add a missing comma in the documentation of Time 2018-11-08 18:02:11 +00:00
unicode
unsafe unsafe: document that Alignof, Offsetof, and Sizeof return a constant 2018-10-11 02:32:20 +00:00
vendor/golang_org/x crypto/tls: implement TLS 1.3 cryptographic computations 2018-11-02 21:54:52 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash
make.bat
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc