]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: eliminate successive swaps
authorAlejandro García Montoro <alejandro.garciamontoro@gmail.com>
Fri, 14 May 2021 16:42:16 +0000 (18:42 +0200)
committerKeith Randall <khr@golang.org>
Sat, 9 Oct 2021 01:04:29 +0000 (01:04 +0000)
commite1c294a56d5d03cdba1f059cdb6b1225477dc546
treeef0d6bae89b2c4f81449091a0688b5299a6395f6
parent74abcabf3045d2c893a517c872ace719f0e9d88f
cmd/compile: eliminate successive swaps

The code generated when storing eight bytes loaded from memory in big
endian introduced two successive byte swaps that did not actually
modified the data.

The new rules match this specific pattern both for amd64 and for arm64,
eliminating the double swap.

Fixes #41684

Change-Id: Icb6dc20b68e4393cef4fe6a07b33aba0d18c3ff3
Reviewed-on: https://go-review.googlesource.com/c/go/+/320073
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Daniel Martí <mvdan@mvdan.cc>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/ARM64.rules
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/rewriteARM64.go
test/codegen/memcombine.go