From 8f739162e6479e98b0950ac9dc2f69cd79031be2 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Sun, 7 Dec 2025 04:08:28 +0100 Subject: [PATCH] cmd/compile: cleanup noLimit in prove - make it immutable - calculate it rather than using hardcoded value (it all is inlined and constant folded away into noLimit's callers) Change-Id: Ica12442df4d03e99123e62c0fe561c1078e35d75 Reviewed-on: https://go-review.googlesource.com/c/go/+/727181 Auto-Submit: Jorropo Reviewed-by: Keith Randall Reviewed-by: Keith Randall Reviewed-by: Carlos Amedee LUCI-TryBot-Result: Go LUCI --- src/cmd/compile/internal/ssa/prove.go | 32 ++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/cmd/compile/internal/ssa/prove.go b/src/cmd/compile/internal/ssa/prove.go index 3de964f0612..c9f75daa672 100644 --- a/src/cmd/compile/internal/ssa/prove.go +++ b/src/cmd/compile/internal/ssa/prove.go @@ -250,6 +250,10 @@ func fitsInBitsU(x uint64, b uint) bool { return x>>b == 0 } +func noLimit() limit { + return noLimitForBitsize(64) +} + func noLimitForBitsize(bitsize uint) limit { return limit{min: -(1 << (bitsize - 1)), max: 1<<(bitsize-1) - 1, umin: 0, umax: 1< 0 { lim = lim.unsignedMin(a.umin / b.umax) }