go/src
Josh Bleecher Snyder c9ccdf1f8c cmd/compile: make deadcode pass cheaper
The deadcode pass runs a lot.
I'd like it to run even more.

This change adds dedicated storage for deadcode to ssa.Cache.
In addition to being a nice win now, it makes
deadcode easier to add other places in the future.

name        old time/op       new time/op       delta
Template          210ms ± 3%        209ms ± 2%    ~     (p=0.951 n=93+95)
Unicode          92.2ms ± 3%       93.0ms ± 3%  +0.87%  (p=0.000 n=94+94)
GoTypes           739ms ± 2%        733ms ± 2%  -0.84%  (p=0.000 n=92+94)
Compiler          3.51s ± 2%        3.49s ± 2%  -0.57%  (p=0.000 n=94+91)
SSA               9.80s ± 2%        9.75s ± 2%  -0.57%  (p=0.000 n=95+92)
Flate             132ms ± 2%        132ms ± 3%    ~     (p=0.165 n=94+98)
GoParser          160ms ± 3%        159ms ± 3%  -0.42%  (p=0.005 n=96+94)
Reflect           446ms ± 4%        442ms ± 4%  -0.91%  (p=0.000 n=95+98)
Tar               186ms ± 3%        186ms ± 2%    ~     (p=0.221 n=94+97)
XML               252ms ± 2%        250ms ± 2%  -0.55%  (p=0.000 n=95+94)
[Geo mean]        430ms             429ms       -0.34%

name        old user-time/op  new user-time/op  delta
Template          256ms ± 3%        257ms ± 3%    ~     (p=0.521 n=94+98)
Unicode           120ms ± 9%        121ms ± 9%    ~     (p=0.074 n=99+100)
GoTypes           935ms ± 3%        935ms ± 2%    ~     (p=0.574 n=82+96)
Compiler          4.56s ± 1%        4.55s ± 2%    ~     (p=0.247 n=88+90)
SSA               13.6s ± 2%        13.6s ± 1%    ~     (p=0.277 n=94+95)
Flate             155ms ± 3%        156ms ± 3%    ~     (p=0.181 n=95+100)
GoParser          193ms ± 8%        184ms ± 6%  -4.39%  (p=0.000 n=100+89)
Reflect           549ms ± 3%        552ms ± 3%  +0.45%  (p=0.036 n=94+96)
Tar               230ms ± 4%        230ms ± 4%    ~     (p=0.670 n=97+99)
XML               315ms ± 5%        309ms ±12%  -2.05%  (p=0.000 n=99+99)
[Geo mean]        540ms             538ms       -0.47%

name        old alloc/op      new alloc/op      delta
Template         40.3MB ± 0%       38.9MB ± 0%  -3.36%  (p=0.008 n=5+5)
Unicode          28.6MB ± 0%       28.4MB ± 0%  -0.90%  (p=0.008 n=5+5)
GoTypes           137MB ± 0%        132MB ± 0%  -3.65%  (p=0.008 n=5+5)
Compiler          637MB ± 0%        609MB ± 0%  -4.40%  (p=0.008 n=5+5)
SSA              2.19GB ± 0%       2.07GB ± 0%  -5.63%  (p=0.008 n=5+5)
Flate            25.0MB ± 0%       24.1MB ± 0%  -3.80%  (p=0.008 n=5+5)
GoParser         30.0MB ± 0%       29.1MB ± 0%  -3.17%  (p=0.008 n=5+5)
Reflect          87.1MB ± 0%       84.4MB ± 0%  -3.05%  (p=0.008 n=5+5)
Tar              37.3MB ± 0%       36.0MB ± 0%  -3.31%  (p=0.008 n=5+5)
XML              49.8MB ± 0%       48.0MB ± 0%  -3.69%  (p=0.008 n=5+5)
[Geo mean]       87.6MB            84.6MB       -3.50%

name        old allocs/op     new allocs/op     delta
Template           387k ± 0%         380k ± 0%  -1.76%  (p=0.008 n=5+5)
Unicode            342k ± 0%         341k ± 0%  -0.31%  (p=0.008 n=5+5)
GoTypes           1.39M ± 0%        1.37M ± 0%  -1.64%  (p=0.008 n=5+5)
Compiler          5.68M ± 0%        5.60M ± 0%  -1.41%  (p=0.008 n=5+5)
SSA               17.1M ± 0%        16.8M ± 0%  -1.49%  (p=0.008 n=5+5)
Flate              240k ± 0%         236k ± 0%  -1.99%  (p=0.008 n=5+5)
GoParser           309k ± 0%         304k ± 0%  -1.57%  (p=0.008 n=5+5)
Reflect           1.01M ± 0%        0.99M ± 0%  -2.69%  (p=0.008 n=5+5)
Tar                360k ± 0%         353k ± 0%  -1.91%  (p=0.008 n=5+5)
XML                447k ± 0%         441k ± 0%  -1.26%  (p=0.008 n=5+5)
[Geo mean]         858k              844k       -1.60%

Fixes #15306

Change-Id: I9f558adb911efddead3865542fe2ca71f66fe1da
Reviewed-on: https://go-review.googlesource.com/c/go/+/166718
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2019-03-11 21:20:01 +00:00
..
archive archive/tar, syscall: add statUnix for aix/ppc64 2019-02-27 23:40:20 +00:00
bufio bufio: fix emptyFinalToken example to handle multiple Reads 2019-03-02 18:28:10 +00:00
builtin builtin: document when len and cap are constant 2018-09-18 21:52:11 +00:00
bytes bytes: return early in Repeat if count is 0 2019-03-09 14:17:13 +00:00
cmd cmd/compile: make deadcode pass cheaper 2019-03-11 21:20:01 +00:00
compress compress/gzip: clarify that Multistream gzip requires a ByteReader 2019-02-26 23:02:40 +00:00
container container/heap: avoid memory leak in example 2019-02-26 23:42:26 +00:00
context context: avoid duplicate removeChild 2018-10-03 15:26:10 +00:00
crypto all: move internal/x to vendor/golang.org/x and revendor using 'go mod vendor' 2019-03-11 20:28:54 +00:00
database/sql database/sql: fix comment grammar 2019-03-07 05:19:01 +00:00
debug debug/gosym: simplify parsing symbol name rule 2019-03-09 00:24:42 +00:00
encoding all: simplify multiple for loops 2019-03-08 14:29:19 +00:00
errors errors: add Unwrap, Is, and As 2019-02-27 19:09:40 +00:00
expvar expvar: add Map.Delete 2018-10-04 01:16:52 +00:00
flag flag: improve docs for PrintDefaults; clarify how to change output destination 2019-01-21 05:30:12 +00:00
fmt fmt: rewrite if-else-if-else chain to switch statement 2019-03-06 15:12:49 +00:00
go all: move internal/x to vendor/golang.org/x and revendor using 'go mod vendor' 2019-03-11 20:28:54 +00:00
hash hash/fnv: use bits.Mul64 for 128-bit hash 2018-12-10 22:50:48 +00:00
html html/template: prevent test from failing with nil pointer dereference 2019-03-02 01:53:40 +00:00
image image/png: delete unused statement 2019-02-28 18:24:51 +00:00
index/suffixarray index/suffixarray: fix a typo mistake in comments 2018-05-29 12:16:51 +00:00
internal all: move internal/x to vendor/golang.org/x and revendor using 'go mod vendor' 2019-03-11 20:28:54 +00:00
io io: align style of test comments in multi_test.go 2019-02-26 23:01:20 +00:00
log log: make the name of error clearer 2019-03-07 15:36:29 +00:00
math math/big: add fast path for amd64 addVW for large z 2019-03-09 20:34:40 +00:00
mime mime/multipart: quote boundary in Content-Type if necessary 2018-12-13 23:58:06 +00:00
net all: move internal/x to vendor/golang.org/x and revendor using 'go mod vendor' 2019-03-11 20:28:54 +00:00
os internal/poll: make FD.isFile mean whether it isn't socket on Windows 2019-03-06 18:04:33 +00:00
path path/filepath: don't discard .. in EvalSymlinks 2019-03-05 01:01:11 +00:00
plugin plugin: fix build constraint to disable test on linux/arm64 2018-11-28 18:14:20 +00:00
reflect reflect: make all flag.mustBe* methods inlinable 2019-03-09 19:50:24 +00:00
regexp regexp: add ReplaceAllStringFunc example 2019-02-27 21:48:41 +00:00
runtime runtime: safely load DLLs 2019-03-10 05:40:13 +00:00
sort sort: change let to let's 2019-01-27 01:34:56 +00:00
strconv strconv: simplify (*extFloat).Multiply using math/bits.Mul64 2019-03-04 22:25:21 +00:00
strings strings: remove unnecessary strings.s 2019-03-10 15:52:22 +00:00
sync sync: allow inlining the RWMutex.RUnlock fast path 2019-03-09 16:34:17 +00:00
syscall syscall: skip non-root user namespace test if kernel forbids 2019-03-10 21:01:02 +00:00
testdata Revert "compress: move benchmark text from src/testdata to src/compress/testdata" 2018-10-01 16:16:21 +00:00
testing testing: enable examples on js/wasm with non os.Pipe runExample 2019-03-11 18:59:53 +00:00
text all: simplify multiple for loops 2019-03-08 14:29:19 +00:00
time time: add support for day-of-year in Format and Parse 2019-03-08 01:21:33 +00:00
unicode unicode: improve generated comments for categories 2018-11-28 03:12:48 +00:00
unsafe cmd/compile: assume unsafe pointer arithmetic generates non-nil results 2018-11-14 21:01:36 +00:00
vendor all: move internal/x to vendor/golang.org/x and revendor using 'go mod vendor' 2019-03-11 20:28:54 +00:00
all.bash Revert "build: fail nicely if somebody runs all.bash from a binary tarball package" 2017-04-28 21:19:32 +00:00
all.bat
all.rc
bootstrap.bash bootstrap.bash: only fetch git revision if we need it 2018-01-30 15:11:56 +00:00
buildall.bash src/*.bash: use tabs consistently 2017-03-09 21:30:31 +00:00
clean.bash
clean.bat
clean.rc
cmp.bash all: make copyright headers consistent with one space after period 2016-11-04 20:46:25 +00:00
go.mod all: move internal/x to vendor/golang.org/x and revendor using 'go mod vendor' 2019-03-11 20:28:54 +00:00
go.sum all: move internal/x to vendor/golang.org/x and revendor using 'go mod vendor' 2019-03-11 20:28:54 +00:00
iostest.bash cmd/dist: build exec wrappers during bootstrap 2019-02-26 17:59:23 +00:00
make.bash cmd,std: add go.mod files 2019-03-11 20:27:41 +00:00
make.bat cmd,std: add go.mod files 2019-03-11 20:27:41 +00:00
Make.dist
make.rc cmd,std: add go.mod files 2019-03-11 20:27:41 +00:00
naclmake.bash all: use consistent shebang line across all shell scripts 2018-08-22 16:41:11 +00:00
nacltest.bash all: use consistent shebang line across all shell scripts 2018-08-22 16:41:11 +00:00
race.bash cmd,runtime: enable race detector on arm64 2018-11-13 16:57:22 +00:00
race.bat cmd/dist: fix compilation on windows 2018-08-25 22:39:17 +00:00
run.bash all: move internal/x to vendor/golang.org/x and revendor using 'go mod vendor' 2019-03-11 20:28:54 +00:00
run.bat build: clear GO111MODULE during make.bash etc 2018-11-16 18:54:22 +00:00
run.rc build: clear GO111MODULE during make.bash etc 2018-11-16 18:54:22 +00:00