]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: improve integer comparisons with numeric bounds
authorJorropo <jorropo.pgm@gmail.com>
Wed, 10 Jan 2024 06:31:57 +0000 (07:31 +0100)
committerGopher Robot <gobot@golang.org>
Tue, 23 Jan 2024 00:02:36 +0000 (00:02 +0000)
commitbbd0bc22ea4bc447a4d009db7d5137688820896d
tree2bc5744f46afe2f2d8e4da9be085d5144a6a0eb1
parent370f1a88edfec10c071fbf700328048a83bee9fc
cmd/compile: improve integer comparisons with numeric bounds

This do:
- Fold always false or always true comparisons for ints and uint.
- Reduce < and <= where the true set is only one value to == with such value.

Change-Id: Ie9e3f70efd1845bef62db56543f051a50ad2532e
Reviewed-on: https://go-review.googlesource.com/c/go/+/555135
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/ssa/_gen/generic.rules
src/cmd/compile/internal/ssa/rewritegeneric.go
test/fuse.go
test/prove.go