go/src/cmd
David Chase 7f1ff65c39 cmd/compile: insert scheduling checks on loop backedges
Loop breaking with a counter.  Benchmarked (see comments),
eyeball checked for sanity on popular loops.  This code
ought to handle loops in general, and properly inserts phi
functions in cases where the earlier version might not have.

Includes test, plus modifications to test/run.go to deal with
timeout and killing looping test.  Tests broken by the addition
of extra code (branch frequency and live vars) for added
checks turn the check insertion off.

If GOEXPERIMENT=preemptibleloops, the compiler inserts reschedule
checks on every backedge of every reducible loop.  Alternately,
specifying GO_GCFLAGS=-d=ssa/insert_resched_checks/on will
enable it for a single compilation, but because the core Go
libraries contain some loops that may run long, this is less
likely to have the desired effect.

This is intended as a tool to help in the study and diagnosis
of GC and other latency problems, now that goal STW GC latency
is on the order of 100 microseconds or less.

Updates #17831.
Updates #10958.

Change-Id: I6206c163a5b0248e3f21eb4fc65f73a179e1f639
Reviewed-on: https://go-review.googlesource.com/33910
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-01-09 21:01:29 +00:00
..
addr2line all: use testing.GoToolPath instead of "go" 2016-08-30 22:49:11 +00:00
api api: promote next.txt to go1.8.txt, update go tool 2016-12-01 02:54:21 +00:00
asm cmd/asm: fix parsing of the s390x instructions VSTE{G,F,H,B} 2016-11-28 18:33:23 +00:00
cgo cmd/cgo: don't strip qualifiers from C void* pointer 2016-12-14 00:59:38 +00:00
compile cmd/compile: insert scheduling checks on loop backedges 2017-01-09 21:01:29 +00:00
cover cmd/cover: fix spelling mistake 2016-12-20 04:45:25 +00:00
dist cmd/dist: enable extLink tests for s390x 2017-01-03 18:08:58 +00:00
doc cmd/doc: show documentation for interface methods when requested explicitly 2016-10-25 20:09:49 +00:00
fix cmd/fix: add golang.org/x/net/context fix 2016-09-15 19:24:04 +00:00
go cmd/go: add link to env varible guide to set custom GOPATH 2017-01-07 00:53:18 +00:00
gofmt cmd/gofmt: don't call Chmod on windows 2016-11-23 01:55:21 +00:00
internal cmd/compile: insert scheduling checks on loop backedges 2017-01-09 21:01:29 +00:00
link cmd/link: use 64k segment alignment on linux/arm 2017-01-04 18:32:38 +00:00
nm all: use sort.Slice where applicable 2016-10-04 05:10:56 +00:00
objdump cmd/objdump: disable objdump_test with external linking on GOARCH=mips{,le} 2016-12-15 00:11:51 +00:00
pack all: use testing.GoToolPath instead of "go" 2016-08-30 22:49:11 +00:00
pprof cmd/pprof: Re-enable weblist and disasm 2016-12-22 22:43:44 +00:00
trace cmd/trace: fix goroutine view 2016-11-18 17:49:18 +00:00
vendor cmd/vendor/golang.org/x/arch/ppc64/ppc64asm: skip TestObjdumpPowerManual if not ppc64x 2016-11-01 17:00:46 +00:00
vet cmd/vet: include function name or value in copylock message 2017-01-03 19:23:23 +00:00