aboutsummaryrefslogtreecommitdiff
path: root/test/loopbce.go
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2017-06-21 17:19:24 -0400
committerDavid Chase <drchase@google.com>2017-06-21 22:07:33 +0000
commit0b6fbaae6ec4218fc35d8a6f4415ae8f88198301 (patch)
tree190fe7f95117686fd55fb86e1d73c5554fe53023 /test/loopbce.go
parentc4e0e816531b679b3e6581e469279df813a9ea3d (diff)
downloadgo-0b6fbaae6ec4218fc35d8a6f4415ae8f88198301.tar.gz
go-0b6fbaae6ec4218fc35d8a6f4415ae8f88198301.zip
cmd/compile: make loop guard+rotate conditional on GOEXPERIMENT
Loops of the form "for i,e := range" needed to have their condition rotated to the "bottom" for the preemptible loops GOEXPERIMENT, but this caused a performance regression because it degraded bounds check removal. For now, make the loop rotation/guarding conditional on the experiment. Fixes #20711. Updates #10958. Change-Id: Icfba14cb3b13a910c349df8f84838cf4d9d20cf6 Reviewed-on: https://go-review.googlesource.com/46410 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'test/loopbce.go')
-rw-r--r--test/loopbce.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/loopbce.go b/test/loopbce.go
index 63bb4bae58..857cf2442b 100644
--- a/test/loopbce.go
+++ b/test/loopbce.go
@@ -31,7 +31,7 @@ func f0c(a []int) int {
func f1(a []int) int {
x := 0
- for _, i := range a { // Change to "for i,e := range array/slice" hides IV report.
+ for _, i := range a { // ERROR "Induction variable with minimum 0 and increment 1"
x += i
}
return x