-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: remove bounds checking for sub-slices #14905
Comments
I think you mean p[8:16], not p[8:8]. p[8:8] is guaranteed to panic when given to a. But I think your general issue is still there. p[8:16] looks ok, but p[7:15] has the same extra comparison in there that p[8:8] has. After we do cap(p)>=16, we know to get rid of another cap(p)>=16, but not a cap(p)>=15. |
It should be |
There is some more opportunity here to optimize:
So we have v8 >= v9. Later
v35 cannot be true. Related to #14900. |
Shows up occassionally, especially after p = p[:8:len(p)] Updates #14905 Change-Id: Iab35ef2eac57817e6a10c6aaeeb84709e8021641 Reviewed-on: https://go-review.googlesource.com/21025 Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
I think this is fixed after https://go-review.googlesource.com/#/c/21008/ |
Yep, I just confirmed, closing. |
Please answer these questions before submitting your issue. Thanks!
go version
)?go version devel +259b7ed 2016-03-22 00:18:31 +0000 linux/amd64
go env
)?Linux Ava 4.4.5-1-ARCH #1 SMP PREEMPT Thu Mar 10 07:38:19 CET 2016 x86_64 GNU/Linux
No check for p[8:8]
On a side note, by inlining that function by hand, some of my code is now faster than using unsafe, so there's that.
Amazing job with the SSA branch guys.
The text was updated successfully, but these errors were encountered: