]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: add arch-specific inlining for runtime.memmove
authorRuslan Andreev <ruslan.andreev@huawei.com>
Tue, 19 Jan 2021 14:30:10 +0000 (22:30 +0800)
committerKeith Randall <khr@golang.org>
Wed, 12 May 2021 16:23:30 +0000 (16:23 +0000)
commit3b321a9d122f0dbf8b333cc79bbf61218e3d05ba
tree8bc8bfeb9f886a84f695ca542623e58df30d544d
parent07ff596404b03a8e01ed53f1553c59eb215dc697
cmd/compile: add arch-specific inlining for runtime.memmove

This CL add runtime.memmove inlining for AMD64 and ARM64.
According to ssa dump from testcases generic rules can't inline
memmomve properly due to one of the arguments is Phi operation. But this
Phi op will be optimized out by later optimization stages. As a result
memmove can be inlined during arch-specific rules.
The commit add new optimization rules to arch-specific rules that can
inline runtime.memmove if it possible during lowering stage.
Optimization fires 5 times in Go source-code using regabi.

Fixes #41662

Change-Id: Iaffaf4c482d068b5f0683d141863892202cc8824
Reviewed-on: https://go-review.googlesource.com/c/go/+/289151
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/ARM64.rules
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/rewriteARM64.go
test/codegen/copy.go