diff options
| author | Michael Munday <mndygolang+git@gmail.com> | 2025-08-26 21:17:36 +0100 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-11-14 10:59:56 -0800 |
| commit | 0a569528ea355099af864f7612c3fa1973df30e4 (patch) | |
| tree | 189f828573801d88d072ebd988ae1d553d2a8afa /test/codegen/arithmetic.go | |
| parent | 1e5e6663e958dcc9579fb38ffcd8a1999d75128d (diff) | |
| download | go-0a569528ea355099af864f7612c3fa1973df30e4.tar.xz | |
cmd/compile: optimize comparisons with single bit difference
Optimize comparisons with constants that only differ by 1 bit (i.e.
a power of 2). For example:
x == 4 || x == 6 -> x|2 == 6
x != 1 && x != 5 -> x|4 != 5
Change-Id: Ic61719e5118446d21cf15652d9da22f7d95b2a15
Reviewed-on: https://go-review.googlesource.com/c/go/+/719420
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'test/codegen/arithmetic.go')
0 files changed, 0 insertions, 0 deletions
