]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: tighten bounds for induction variables in strided loops
authorKeith Randall <khr@golang.org>
Sun, 3 Jul 2022 21:52:47 +0000 (14:52 -0700)
committerKeith Randall <khr@golang.org>
Wed, 31 Aug 2022 22:04:55 +0000 (22:04 +0000)
commitaf7f067e0d7f92bcf4d0938d093725a0ac6366b1
treea567acc9936f6c3d8af4ab4a1b885875be87f824
parent52d9e7f543f68a46d7a69443a1ad51283d2f0d4f
cmd/compile: tighten bounds for induction variables in strided loops

for i := 0; i < 9; i += 3

Currently we compute bounds of [0,8]. Really we know that it is [0,6].

CL 415874 computed the better bound as part of overflow detection.
This CL just incorporates that better info to the prove pass.

R=go1.20

Change-Id: Ife82cc415321f6652c2b5d132a40ec23e3385766
Reviewed-on: https://go-review.googlesource.com/c/go/+/415937
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/loopbce.go
test/loopbce.go