Fixes #76688
Change-Id: Icb8dab54a5ce7d83b656d50d5ea605d2a62b96f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/726680
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
xl := ft.limits[x.ID]
y := v.Args[1]
yl := ft.limits[y.ID]
- if xl.umin == xl.umax && isPowerOfTwo(int64(xl.umin)) ||
+ if xl.umin == xl.umax && isUnsignedPowerOfTwo(xl.umin) ||
xl.min == xl.max && isPowerOfTwo(xl.min) ||
- yl.umin == yl.umax && isPowerOfTwo(int64(yl.umin)) ||
+ yl.umin == yl.umax && isUnsignedPowerOfTwo(yl.umin) ||
yl.min == yl.max && isPowerOfTwo(yl.min) {
// 0,1 * a power of two is better done as a shift
break
return false
}
+func issue76688(x, y uint64) uint64 {
+ if x > 1 || y != 1<<63 {
+ return 42
+ }
+ // We do not want to rewrite the multiply to a condselect here since opt can do a better job with a left shift.
+ return x * y
+}
+
//go:noinline
func prove(x int) {
}