diff options
| author | Alexander Musman <alexander.musman@gmail.com> | 2025-06-07 12:00:11 +0300 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-07-24 13:47:20 -0700 |
| commit | bd80f74bc154585237a3c1b636e30dab6d781923 (patch) | |
| tree | 27e6984202cd5192a1fe3ff5efa7f9b6b6670302 /src/runtime/error.go | |
| parent | 5c45fe1385ff30b1a138dd3dae7fc670f85dfcc9 (diff) | |
| download | go-bd80f74bc154585237a3c1b636e30dab6d781923.tar.xz | |
cmd/compile: fold shift through AND for slice operations
Fold a shift through AND when the AND gets a zero-or-one operand (e.g.
from arithmetic shift by 63 of a 64-bit value) for a common case with
slice operations:
ASR $63, R2, R2
AND R3<<3, R2, R2
ADD R2, R0, R2
As the operands are 64-bit, we can transform it to:
AND R2->63, R3, R2
ADD R2<<3, R0, R2
Code size improvement:
compile: .text: 9088004 -> 9086292 (-0.02%)
etcd: .text: 10500276 -> 10498964 (-0.01%)
Change-Id: Ibcd5e67173da39b77ceff77ca67812fb8be5a7b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/679895
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Mark Freeman <mark@golang.org>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/error.go')
0 files changed, 0 insertions, 0 deletions
