]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/ssa: inline memmove with known size
authorIlya Tocar <ilya.tocar@intel.com>
Wed, 9 Aug 2017 19:00:38 +0000 (14:00 -0500)
committerIlya Tocar <ilya.tocar@intel.com>
Thu, 2 Nov 2017 20:30:25 +0000 (20:30 +0000)
commitf3884680fcbda5640e14a01d17aa38d06c70891f
treec8611d9e8f58cf93097acc795a6d368c5e407679
parentad3742f4acbf20c681c9f6f6775ea7ece85e5881
cmd/compile/internal/ssa: inline memmove with known size

Replace calls to memmove with known (constant) size, with OpMove.
Do it only if it is safe from aliasing point of view.
Helps with code like this:

append(buf,"const str"...)

In strconv this provides nice benefit:
Quote-6                                   731ns ± 2%   647ns ± 3%  -11.41%  (p=0.000 n=10+10)
QuoteRune-6                               117ns ± 5%   111ns ± 1%   -4.54%  (p=0.000 n=10+10)
AppendQuote-6                             475ns ± 0%   396ns ± 0%  -16.59%  (p=0.000 n=9+10)
AppendQuoteRune-6                        32.0ns ± 0%  27.4ns ± 0%  -14.41%  (p=0.000 n=8+9)

Change-Id: I7704f5c51b46aed2d8f033de74c75140fc35036c
Reviewed-on: https://go-review.googlesource.com/54394
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/asm_test.go
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewrite_test.go
src/cmd/compile/internal/ssa/rewritegeneric.go