]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/ssa: Use transitive properties for len/cap
authorDaniel Morsing <daniel.morsing@gmail.com>
Wed, 4 Jun 2025 08:22:21 +0000 (09:22 +0100)
committerKeith Randall <khr@golang.org>
Tue, 5 Aug 2025 15:58:11 +0000 (08:58 -0700)
commita3295df873bb22b3ba427124b1220370a5ca5cdb
tree4fc3d9e4419c45dcb39356a670c385b5f2dc297c
parentbd082857a55b81acfd5b341c41dd90e29c159bd7
cmd/compile/internal/ssa: Use transitive properties for len/cap

Remove the special casing for len/cap and rely on the posets.

After removing the special logic, I ran `go build -gcflags='-d
ssa/prove/debug=2' all` to verify my results. During this, I found 2
common cases where the old implicit unsigned->signed domain conversion
made proving a branch possible that shouldn't be strictly possible and
added these.

The 2 cases are shifting a non-negative signed integer and unsigned
comparisons that happen with arguments that fits entirely inside the
unsigned argument

Change-Id: Ic88049ff69efc5602fc15f5dad02028e704f5483
Reviewed-on: https://go-review.googlesource.com/c/go/+/679155
Reviewed-by: Mark Freeman <mark@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/prove.go