go/src
Ilya Tocar 983dcf70ba cmd/compile/internal/ssa: update regalloc in loops
Currently we don't lift spill out of loop if loop contains call.
However often we have code like this:

for .. {
    if hard_case {
	call()
    }
    // simple case, without call
}

So instead of checking for any call, check for unavoidable call.
For #22698 cases I see:
mime/quotedprintable/Writer-6                   10.9µs ± 4%      9.2µs ± 3%   -15.02%  (p=0.000 n=8+8)
And:
compress/flate/Encode/Twain/Huffman/1e4-6       99.4µs ± 6%     90.9µs ± 0%    -8.57%  (p=0.000 n=8+8)
compress/flate/Encode/Twain/Huffman/1e5-6       760µs ± 1%      725µs ± 1%     -4.56%  (p=0.000 n=8+8)
compress/flate/Encode/Twain/Huffman/1e6-6       7.55ms ± 0%      7.24ms ± 0%     -4.07%  (p=0.000 n=8+7)

There are no significant changes on go1 benchmarks.
But for cases with runtime arch checks, where we call generic version on old hardware,
there are respectable performance gains:
math/RoundToEven-6                             1.43ns ± 0%     1.25ns ± 0%   -12.59%  (p=0.001 n=7+7)
math/bits/OnesCount64-6                        1.60ns ± 1%     1.42ns ± 1%   -11.32%  (p=0.000 n=8+8)

Also on some runtime benchmarks loops have less loads and higher performance:
runtime/RuneIterate/range1/ASCII-6             15.6ns ± 1%     13.9ns ± 1%   -10.74%  (p=0.000 n=7+8)
runtime/ArrayEqual-6                           3.22ns ± 0%     2.86ns ± 2%   -11.06%  (p=0.000 n=7+8)

Fixes #22698
Updates #22234

Change-Id: I0ae2f19787d07a9026f064366dedbe601bf7257a
Reviewed-on: https://go-review.googlesource.com/84055
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2018-03-20 21:02:39 +00:00
..
archive archive/zip: improve Writer.Create documentation on how to add directories 2018-02-26 19:58:48 +00:00
bufio
builtin
bytes internal/bytealg: move short string Index implementations into bytealg 2018-03-04 19:49:44 +00:00
cmd cmd/compile/internal/ssa: update regalloc in loops 2018-03-20 21:02:39 +00:00
compress compress/gzip, compress/zlib: fix Writer documentation inconsistencies 2018-03-13 20:58:19 +00:00
container
context
crypto crypto/x509: don't require C99 mode in Darwin cgo code 2018-03-17 17:52:47 +00:00
database/sql database/sql: fix typo in comment 2018-03-07 15:42:31 +00:00
debug debug/pe: use bytes.IndexByte instead of a loop 2018-03-07 16:12:08 +00:00
encoding all: fix non-standard "DO NOT EDIT" comments for generated files 2018-03-10 17:50:11 +00:00
errors
expvar
flag
fmt fmt: change some unexported method names to camel case 2018-02-27 20:12:04 +00:00
go go/constant: add examples for working with constant.Value 2018-03-19 19:56:41 +00:00
hash crypto: remove hand encoded amd64 instructions 2018-03-01 19:20:53 +00:00
html all: fix misspellings 2018-02-20 21:02:58 +00:00
image all: fix non-standard "DO NOT EDIT" comments for generated files 2018-03-10 17:50:11 +00:00
index/suffixarray
internal Revert "bytes: add optimized Compare for arm64" 2018-03-20 00:10:24 +00:00
io
log
math math/big: reduce amount of copying in Montgomery multiplication 2018-03-19 21:40:56 +00:00
mime mime/multipart: test for presence of filename instead of content-type 2018-03-10 00:33:10 +00:00
net net: treat a nil *Resolver as a zero one, as documented 2018-03-19 17:01:23 +00:00
os os: use WIN32_FIND_DATA.Reserved0 to identify symlinks 2018-03-07 08:51:04 +00:00
path path/filepath: use a temp dir in path_test.go 2018-03-05 23:38:39 +00:00
plugin
reflect reflect: sort exported methods first 2018-03-15 21:56:08 +00:00
regexp regexp: Regexp shouldn't keep references to inputs 2018-02-23 16:58:48 +00:00
runtime cmd/compile: avoid mapaccess at m[k]=append(m[k].. 2018-03-20 01:47:07 +00:00
sort sort: fix typo, was a mixup between identifiers 'unsorted' and 'data' 2018-03-19 13:09:29 +00:00
strconv strconv: make code formatting more consistent in doc.go 2018-03-19 12:53:16 +00:00
strings internal/bytealg: move short string Index implementations into bytealg 2018-03-04 19:49:44 +00:00
sync sync: make WaitGroup more space-efficient 2018-03-15 09:56:25 +00:00
syscall syscall: use Android O friendly fstatat syscall to implement Stat on linux/amd64 2018-03-15 10:07:57 +00:00
testing testing: gracefully handle subtest failing parent’s T 2018-03-01 10:17:22 +00:00
text text/scanner: add examples 2018-03-10 02:01:58 +00:00
time time: add support for parsing timezones denoted by sign and offset 2018-03-08 17:15:35 +00:00
unicode
unsafe unsafe: fix reference to string header 2018-02-26 18:35:46 +00:00
vendor/golang_org/x vendor: update golang.org/x/net/dns/dnsmessage from upstream 2018-03-18 05:48:38 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash androidtest.bash: don't require GOARCH set 2018-03-07 14:01:43 +00:00
bootstrap.bash bootstrap.bash: only fetch git revision if we need it 2018-01-30 15:11:56 +00:00
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash iostest.bash: don't build std library twice 2018-03-06 16:08:20 +00:00
make.bash
make.bat build: small cleanup in error message in make.bat 2018-02-26 10:27:14 +00:00
make.rc
naclmake.bash nacl*.bash: pass flags to make.bash 2018-02-14 17:09:31 +00:00
nacltest.bash nacl*.bash: pass flags to make.bash 2018-02-14 17:09:31 +00:00
race.bash
race.bat
run.bash
run.bat
run.rc