go/src/cmd/compile
Josh Bleecher Snyder 85b2940f5c cmd/compile: search for remaining WB ops from end to beginning
The writebarrier pass processes WB ops from beginning to end,
replacing them by other values.
But it also checks whether there are more ops to process
by walking from beginning to end.
This is quadratic, so walk from end to beginning instead.

This speeds up compiling the code in issue 13554:

name  old time/op       new time/op       delta
Pkg         11.9s ± 2%         8.3s ± 3%  -29.88%  (p=0.000 n=18+17)

Updates #13554

Passes toolstash-check.

Change-Id: I5f8a872ddc4b783540220d89ea2ee188a6d2b2ff
Reviewed-on: https://go-review.googlesource.com/43571
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-05-18 20:14:12 +00:00
..
internal cmd/compile: search for remaining WB ops from end to beginning 2017-05-18 20:14:12 +00:00
doc.go cmd/compile: add mutex profiling support 2017-04-05 22:10:54 +00:00
fmt_test.go cmd/compile: change ssa.Type into *types.Type 2017-05-09 23:01:51 +00:00
main.go cmd/internal/objabi: extract shared functionality from obj 2017-04-19 00:00:09 +00:00