]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/ssa: combine consecutive loads and stores on amd64
authorIlya Tocar <ilya.tocar@intel.com>
Fri, 18 Aug 2017 19:03:33 +0000 (14:03 -0500)
committerIlya Tocar <ilya.tocar@intel.com>
Fri, 25 Aug 2017 20:05:17 +0000 (20:05 +0000)
commit9c99512d188b01557f5271b2c65d814487817920
tree466d7ccf0838cabf8a27c766ded30364b332d5ba
parentb40831b115e46e9de719bddccf2d27d7d4940756
cmd/compile/internal/ssa: combine consecutive loads and stores on amd64

Sometimes (often for calls) we generate code like this:

MOVQ  (addr),AX
MOVQ  8(addr),BX
MOVQ  AX,(otheraddr)
MOVQ  BX,8(otheraddr)

Replace it with

MOVUPS (addr),X0
MOVUPS X0,(otheraddr)

For completeness do the same for 8,16,32-bit loads/stores too.
Shaves 1% from code sections of go tool.

/localdisk/itocar/golang/bin/go 10293917
go_old 10334877 [40960 bytes]

read-only data = 682 bytes (0.040769%)
global text (code) = 38961 bytes (1.036503%)
Total difference 39643 bytes (0.674628%)

Updates #6853

Change-Id: I1f0d2f60273a63a079b58927cd1c4e3429d2e7ae
Reviewed-on: https://go-review.googlesource.com/57130
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/asm_test.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewriteAMD64.go