]> Cypherpunks repositories - gostls13.git/commit
[dev.simd] cmd/compile: enhance prove to deal with double-offset IsInBounds checks
authorDavid Chase <drchase@google.com>
Wed, 3 Sep 2025 17:09:32 +0000 (13:09 -0400)
committerDavid Chase <drchase@google.com>
Sun, 7 Sep 2025 10:20:39 +0000 (03:20 -0700)
commit832c1f76dc665f0e211eec12dd77c17fa2ceedd7
treee38082dc0418d03d71e4608aebf0dae213d44a1d
parent0b323350a5a4e996e8bd3312837a8e53735107c1
[dev.simd] cmd/compile: enhance prove to deal with double-offset IsInBounds checks

For chunked iterations (useful for, but not exclusive to,
SIMD calculations) it is common to see the combination of
```
for ; i <= len(m)-4; i += 4 {
```
and
```
r0, r1, r2, r3 := m[i], m[i+1], m[i+2], m[i+3]
``

Prove did not handle the case of len-offset1 vs index+offset2
checking, but this change fixes this.  There may be other
similar cases yet to handle -- this worked for the chunked
loops for simd, as well as a handful in std.

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