]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: in prove, learn facts from OpSliceMake
authorGiovanni Bajo <rasky@develer.com>
Sun, 22 Sep 2019 13:39:16 +0000 (15:39 +0200)
committerGiovanni Bajo <rasky@develer.com>
Thu, 26 Sep 2019 18:27:38 +0000 (18:27 +0000)
commit87e2b34f7bdd997b09f926ccbef6bfd2794d8e2a
treeb5086596b858e48981f37f2babb9d4700a0e2492
parent08165932f77aacf82a1e41138e7650e5992b98f7
cmd/compile: in prove, learn facts from OpSliceMake

Now that OpSliceMake is called by runtime.makeslice callers,
prove can see and record the actual length and cap of each
slice being constructed.

This small patch is enough to remove 260 additional bound checks
from cmd+std.

Thanks to Martin Möhrmann for pointing me to CL141822 that
I had missed.

Updates #24660

Change-Id: I14556850f285392051f3f07d13b456b608b64eb9
Reviewed-on: https://go-review.googlesource.com/c/go/+/196784
Run-TryBot: Giovanni Bajo <rasky@develer.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/prove.go
test/prove.go