]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: inline memequal(x, const, sz) for small sizes
authorRuslan Andreev <kels9009@gmail.com>
Wed, 16 Jun 2021 16:25:57 +0000 (16:25 +0000)
committerCherry Mui <cherryyz@google.com>
Wed, 6 Oct 2021 13:47:50 +0000 (13:47 +0000)
commit810b08b8ec28ea00bce4c008f7c1b48bc9f3e134
treee06230d828b77c201f7642acca57fd30a98ed3c0
parentce72766a02a4be127a26e95fbd62c4b4bb906e91
cmd/compile: inline memequal(x, const, sz) for small sizes

This CL adds late expanded memequal(x, const, sz) inlining for 2, 4, 8
bytes size. This PoC is using the same method as CL 248404.
This optimization fires about 100 times in Go compiler (1675 occurrences
reduced to 1574, so -6%).
Also, added unit-tests to codegen/comparisions.go file.

Updates #37275

Change-Id: Ia52808d573cb706d1da8166c5746ede26f46c5da
Reviewed-on: https://go-review.googlesource.com/c/go/+/328291
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Trust: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewritegeneric.go
test/codegen/comparisons.go