1
0
mirror of https://github.com/golang/go synced 2024-11-12 13:30:29 -07:00
Commit Graph

10777 Commits

Author SHA1 Message Date
Matthew Dempsky
bb2f0da23a cmd/compile: fix compiler crash on recursive types
By setting both a valid size and alignment for broken recursive types,
we can appease some more safety checks and prevent compiler crashes.

Fixes #21882.

Change-Id: Ibaa137d8aa2c2a9d521462f144d7016c4abfd6e7
Reviewed-on: https://go-review.googlesource.com/64430
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-09-18 21:49:43 +00:00
Damien Lespiau
1e607f225e cmd/internal/obj/x86: add ADDSUBPS/PD
These are the last instructions missing to complete SSE3 support.

For reference what was missing was found by a tool [1]:

$ x86db-gogen list --extension SSE3 --not-known
ADDSUBPD xmmreg,xmmrm [rm: 66 0f d0 /r] PRESCOTT,SSE3,SO
ADDSUBPS xmmreg,xmmrm [rm: f2 0f d0 /r] PRESCOTT,SSE3,SO

[1] https://github.com/dlespiau/x86db

Fixes #20293

Change-Id: Ib5a91bf64dcc5282cdb60eae740ae52b4db16ebd
Reviewed-on: https://go-review.googlesource.com/42990
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
2017-09-18 15:06:05 +00:00
Daniel Martí
71c9454f99 cmd/compile: remove some redundant types in decls
As per golint's suggestions.

Change-Id: Ie0c6ad9aa5dc69966a279562a341c7b095c47ede
Reviewed-on: https://go-review.googlesource.com/64192
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-17 09:51:38 +00:00
Michael Munday
a5d6b41449 cmd/compile: test constant folded integer to/from float conversions
Improves test coverage of the rules added in CL 63795 and would have
detected the bug fixed by CL 63950.

Change-Id: I107ee8d8e0b6684ce85b2446bd5018c5a03d608a
Reviewed-on: https://go-review.googlesource.com/64130
Reviewed-by: Keith Randall <khr@golang.org>
2017-09-16 09:17:58 +00:00
Ben Shi
a07176b45a cmd/compile: optimize ARM code with MULAF/MULSF/MULAD/MULSD
The go compiler can generate better ARM code with those more
efficient FP instructions. And there is little improvement
in total but big improvement in special cases.

1. The size of pkg/linux_arm/math.a shrinks by 2.4%.

2. there is neither improvement nor regression in compilecmp benchmark.
name        old time/op       new time/op       delta
Template          2.32s ± 2%        2.32s ± 1%    ~     (p=1.000 n=9+10)
Unicode           1.32s ± 4%        1.32s ± 4%    ~     (p=0.912 n=10+10)
GoTypes           7.76s ± 1%        7.79s ± 1%    ~     (p=0.447 n=9+10)
Compiler          37.4s ± 2%        37.2s ± 2%    ~     (p=0.218 n=10+10)
SSA               84.8s ± 2%        85.0s ± 1%    ~     (p=0.604 n=10+9)
Flate             1.45s ± 2%        1.44s ± 2%    ~     (p=0.075 n=10+10)
GoParser          1.82s ± 1%        1.81s ± 1%    ~     (p=0.190 n=10+10)
Reflect           5.06s ± 1%        5.05s ± 1%    ~     (p=0.315 n=10+9)
Tar               2.37s ± 1%        2.37s ± 2%    ~     (p=0.912 n=10+10)
XML               2.56s ± 1%        2.58s ± 2%    ~     (p=0.089 n=10+10)
[Geo mean]        4.77s             4.77s       -0.08%

name        old user-time/op  new user-time/op  delta
Template          2.74s ± 2%        2.75s ± 2%    ~     (p=0.856 n=9+10)
Unicode           1.61s ± 4%        1.62s ± 3%    ~     (p=0.693 n=10+10)
GoTypes           9.55s ± 1%        9.49s ± 2%    ~     (p=0.056 n=9+10)
Compiler          45.9s ± 1%        45.8s ± 1%    ~     (p=0.345 n=9+10)
SSA                110s ± 1%         110s ± 1%    ~     (p=0.763 n=9+10)
Flate             1.68s ± 2%        1.68s ± 3%    ~     (p=0.616 n=10+10)
GoParser          2.14s ± 4%        2.14s ± 1%    ~     (p=0.825 n=10+9)
Reflect           5.95s ± 1%        5.97s ± 3%    ~     (p=0.951 n=9+10)
Tar               2.94s ± 3%        2.93s ± 2%    ~     (p=0.359 n=10+10)
XML               3.03s ± 3%        3.07s ± 6%    ~     (p=0.166 n=10+10)
[Geo mean]        5.76s             5.77s       +0.12%

name        old text-bytes    new text-bytes    delta
HelloSize         588kB ± 0%        588kB ± 0%    ~     (all equal)

name        old data-bytes    new data-bytes    delta
HelloSize        5.46kB ± 0%       5.46kB ± 0%    ~     (all equal)

name        old bss-bytes     new bss-bytes     delta
HelloSize        72.9kB ± 0%       72.9kB ± 0%    ~     (all equal)

name        old exe-bytes     new exe-bytes     delta
HelloSize        1.03MB ± 0%       1.03MB ± 0%    ~     (all equal)

3. The performance of Mandelbrot200 improves 15%, though little
   improvement in total.
name                     old time/op    new time/op    delta
BinaryTree17-4              41.7s ± 1%     41.7s ± 1%     ~     (p=0.264 n=29+23)
Fannkuch11-4                24.2s ± 0%     24.1s ± 1%   -0.13%  (p=0.050 n=30+30)
FmtFprintfEmpty-4           826ns ± 1%     824ns ± 1%   -0.24%  (p=0.038 n=25+30)
FmtFprintfString-4         1.38µs ± 1%    1.38µs ± 0%   -0.42%  (p=0.000 n=27+25)
FmtFprintfInt-4            1.46µs ± 1%    1.46µs ± 0%     ~     (p=0.060 n=30+23)
FmtFprintfIntInt-4         2.11µs ± 1%    2.08µs ± 0%   -1.04%  (p=0.000 n=30+30)
FmtFprintfPrefixedInt-4    2.23µs ± 1%    2.22µs ± 1%   -0.51%  (p=0.000 n=30+30)
FmtFprintfFloat-4          4.49µs ± 1%    4.48µs ± 1%   -0.22%  (p=0.004 n=26+30)
FmtManyArgs-4              8.06µs ± 1%    8.12µs ± 1%   +0.68%  (p=0.000 n=25+30)
GobDecode-4                 104ms ± 1%     104ms ± 2%     ~     (p=0.362 n=29+29)
GobEncode-4                92.9ms ± 1%    92.8ms ± 2%     ~     (p=0.786 n=30+30)
Gzip-4                      4.12s ± 1%     4.12s ± 1%     ~     (p=0.314 n=30+30)
Gunzip-4                    602ms ± 1%     603ms ± 1%     ~     (p=0.164 n=30+30)
HTTPClientServer-4          659µs ± 1%     655µs ± 2%   -0.64%  (p=0.006 n=25+28)
JSONEncode-4                234ms ± 1%     235ms ± 1%   +0.29%  (p=0.050 n=30+30)
JSONDecode-4                912ms ± 0%     911ms ± 0%     ~     (p=0.385 n=18+24)
Mandelbrot200-4            49.2ms ± 0%    41.7ms ± 0%  -15.35%  (p=0.000 n=25+27)
GoParse-4                  46.3ms ± 1%    46.3ms ± 2%     ~     (p=0.572 n=30+30)
RegexpMatchEasy0_32-4      1.29µs ± 1%    1.27µs ± 0%   -1.59%  (p=0.000 n=30+30)
RegexpMatchEasy0_1K-4      7.62µs ± 4%    7.71µs ± 3%     ~     (p=0.074 n=30+30)
RegexpMatchEasy1_32-4      1.31µs ± 0%    1.30µs ± 1%   -0.71%  (p=0.000 n=23+30)
RegexpMatchEasy1_1K-4      10.3µs ± 3%    10.3µs ± 5%     ~     (p=0.105 n=30+30)
RegexpMatchMedium_32-4     2.06µs ± 1%    2.06µs ± 1%     ~     (p=0.100 n=30+30)
RegexpMatchMedium_1K-4      533µs ± 1%     534µs ± 1%     ~     (p=0.254 n=29+30)
RegexpMatchHard_32-4       28.9µs ± 0%    28.9µs ± 0%     ~     (p=0.154 n=30+30)
RegexpMatchHard_1K-4        868µs ± 1%     867µs ± 0%     ~     (p=0.729 n=30+23)
Revcomp-4                  66.9ms ± 1%    67.2ms ± 2%     ~     (p=0.102 n=28+29)
Template-4                  1.07s ± 1%     1.06s ± 1%   -0.53%  (p=0.000 n=30+30)
TimeParse-4                7.07µs ± 1%    7.01µs ± 0%   -0.85%  (p=0.000 n=30+25)
TimeFormat-4               13.1µs ± 0%    13.2µs ± 1%   +0.77%  (p=0.000 n=27+27)
[Geo mean]                  721µs          716µs        -0.70%

name                     old speed      new speed      delta
GobDecode-4              7.38MB/s ± 1%  7.37MB/s ± 2%     ~     (p=0.399 n=29+29)
GobEncode-4              8.26MB/s ± 1%  8.27MB/s ± 2%     ~     (p=0.790 n=30+30)
Gzip-4                   4.71MB/s ± 1%  4.71MB/s ± 1%     ~     (p=0.885 n=30+30)
Gunzip-4                 32.2MB/s ± 1%  32.2MB/s ± 1%     ~     (p=0.190 n=30+30)
JSONEncode-4             8.28MB/s ± 1%  8.25MB/s ± 1%     ~     (p=0.053 n=30+30)
JSONDecode-4             2.13MB/s ± 0%  2.12MB/s ± 1%     ~     (p=0.072 n=18+30)
GoParse-4                1.25MB/s ± 1%  1.25MB/s ± 2%     ~     (p=0.863 n=30+30)
RegexpMatchEasy0_32-4    24.8MB/s ± 0%  25.2MB/s ± 1%   +1.61%  (p=0.000 n=30+30)
RegexpMatchEasy0_1K-4     134MB/s ± 4%   133MB/s ± 3%     ~     (p=0.074 n=30+30)
RegexpMatchEasy1_32-4    24.5MB/s ± 0%  24.6MB/s ± 1%   +0.72%  (p=0.000 n=23+30)
RegexpMatchEasy1_1K-4    99.1MB/s ± 3%  99.8MB/s ± 5%     ~     (p=0.105 n=30+30)
RegexpMatchMedium_32-4    483kB/s ± 1%   487kB/s ± 1%   +0.83%  (p=0.002 n=30+30)
RegexpMatchMedium_1K-4   1.92MB/s ± 1%  1.92MB/s ± 1%     ~     (p=0.058 n=30+30)
RegexpMatchHard_32-4     1.10MB/s ± 0%  1.11MB/s ± 0%     ~     (p=0.804 n=30+30)
RegexpMatchHard_1K-4     1.18MB/s ± 0%  1.18MB/s ± 0%     ~     (all equal)
Revcomp-4                38.0MB/s ± 1%  37.8MB/s ± 2%     ~     (p=0.098 n=28+29)
Template-4               1.82MB/s ± 1%  1.83MB/s ± 1%   +0.55%  (p=0.000 n=29+29)
[Geo mean]               6.79MB/s       6.79MB/s        +0.09%

Change-Id: Ia91991c2c5c59c5df712de85a83b13a21c0a554b
Reviewed-on: https://go-review.googlesource.com/63770
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-09-15 22:30:34 +00:00
isharipo
8c67f210a1 cmd/internal/obj: change Prog.From3 to RestArgs ([]Addr)
This change makes it easier to express instructions
with arbitrary number of operands.

Rationale: previous approach with operand "hiding" does
not scale well, AVX and especially AVX512 have many
instructions with 3+ operands.

x86 asm backend is updated to handle up to 6 explicit operands.
It also fixes issue with 4-th immediate operand type checks.
All `ytab` tables are updated accordingly.

Changes to non-x86 backends only include these patterns:
`p.From3 = X` => `p.SetFrom3(X)`
`p.From3.X = Y` => `p.GetFrom3().X = Y`

Over time, other backends can adapt Prog.RestArgs
and reduce the amount of workarounds.

-- Performance --

x/benchmark/build:

$ benchstat upstream.bench patched.bench
name      old time/op                 new time/op                 delta
Build-48                  21.7s ± 2%                  21.8s ± 2%   ~     (p=0.218 n=10+10)

name      old binary-size             new binary-size             delta
Build-48                  10.3M ± 0%                  10.3M ± 0%   ~     (all equal)

name      old build-time/op           new build-time/op           delta
Build-48                  21.7s ± 2%                  21.8s ± 2%   ~     (p=0.218 n=10+10)

name      old build-peak-RSS-bytes    new build-peak-RSS-bytes    delta
Build-48                  145MB ± 5%                  148MB ± 5%   ~     (p=0.218 n=10+10)

name      old build-user+sys-time/op  new build-user+sys-time/op  delta
Build-48                  21.0s ± 2%                  21.2s ± 2%   ~     (p=0.075 n=10+10)

Microbenchmark shows a slight slowdown.

name        old time/op  new time/op  delta
AMD64asm-4  49.5ms ± 1%  49.9ms ± 1%  +0.67%  (p=0.001 n=23+15)

func BenchmarkAMD64asm(b *testing.B) {
  for i := 0; i < b.N; i++ {
    TestAMD64EndToEnd(nil)
    TestAMD64Encoder(nil)
  }
}

Change-Id: I4f1d37b5c2c966da3f2127705ccac9bff0038183
Reviewed-on: https://go-review.googlesource.com/63490
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-09-15 21:05:03 +00:00
Alessandro Arzilli
e1cf2be7a8 cmd/compile: fix lexical block of captured variables
Variables captured by a closure were always assigned to the root scope
in their declaration function. Using decl.Name.Defn.Pos will result in
the correct scope for both the declaration function and the capturing
function.

Fixes #21515

Change-Id: I3960aface3c4fc97e15b36191a74a7bed5b5ebc1
Reviewed-on: https://go-review.googlesource.com/56830
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-09-15 21:02:59 +00:00
Matthew Dempsky
37fc70bac3 cmd/internal/objabi: remove unused flag funcs
Change-Id: I728c5606882ece949d58e86f9558fc16ae4ffd85
Reviewed-on: https://go-review.googlesource.com/64052
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-09-15 19:30:37 +00:00
Matthew Dempsky
f84a1db19f cmd/link: replace unrolled Cput loops with Cwrite/Cwritestring
Passes toolstash-check -all.

Change-Id: I1c85a2c0390517f4e9cdbddddbf3c353edca65b3
Reviewed-on: https://go-review.googlesource.com/64051
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-15 19:09:39 +00:00
David Crawshaw
27e80f7c4d cmd/compile: replace GOROOT in //line directives
The compiler replaces any path of the form /path/to/goroot/src/net/port.go
with GOROOT/src/net/port.go so that the same object file is
produced if the GOROOT is moved. It was skipping this transformation
for any absolute path into the GOROOT that came from //line directives,
such as those generated by cmd/cgo.

Fixes #21373
Fixes #21720
Fixes #21825

Change-Id: I2784c701b4391cfb92e23efbcb091a84957d61dd
Reviewed-on: https://go-review.googlesource.com/63693
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-09-15 17:18:43 +00:00
Todd Neal
af86083812 cmd/compile: fix typo in floating point rule
Change-Id: Idfb64fcb26f48d5b70bab872f9a3d96a036be681
Reviewed-on: https://go-review.googlesource.com/63950
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-09-15 03:07:43 +00:00
Kunpei Sakai
5a986eca86 all: fix article typos
a -> an

Change-Id: I7362bdc199e83073a712be657f5d9ba16df3077e
Reviewed-on: https://go-review.googlesource.com/63850
Reviewed-by: Rob Pike <r@golang.org>
2017-09-15 02:39:16 +00:00
Emmanuel Odeke
33cb1481f2 cmd/go: correctly report that -msan needs CGO_ENABLED=1
Previously, if CGO_ENABLED=0 was set when building
with -msan, the error message printed was:

  -race requires cgo; enable cgo by setting CGO_ENABLED=1

yet the instrumentation flag passed in was -msan. This CL
fixes that message to correctly report that -msan needed
CGO_ENABLED=1, and likewise if -race, report -race needed it.

Fixes #21895

Change-Id: If423d520daae7847fb38cc97c3192ada5d960f9d
Reviewed-on: https://go-review.googlesource.com/63930
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-09-15 00:11:18 +00:00
Michael Munday
95b146e8eb cmd/compile: improve floating point constant propagation
Add generic rules to propagate floating point constants through
comparisons and integer conversions. These new rules seldom trigger
in the standard library so there is no performance change, however
I think it is worth adding them anyway for completeness.

Change-Id: I9db5222746508a2996f1cafb72f4e0cf2541de07
Reviewed-on: https://go-review.googlesource.com/63795
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-09-14 23:08:33 +00:00
Lynn Boger
40e25895e3 cmd/compile,math: improve int<->float conversions on ppc64x
The functions Float64bits and Float64frombits perform
poorly on ppc64x because the int<->float conversions
often result in load and store sequences to handle the
type change. This patch adds more rules to recognize
those sequences and use register to register moves
and avoid unnecessary loads and stores where possible.

There were some existing rules to improve these conversions,
but this provides additional improvements. Included here:

- New instruction FCFIDS to improve on conversion to 32 bit
- Rename Xf2i64 and Xi2f64 as MTVSRD, MFVSRD, to match the asm
- Add rules to lower some of the load/store sequences for
- Added new go asm to ppc64.s testcase.
conversions

Improvements:

BenchmarkAbs-16                2.16          0.93          -56.94%
BenchmarkCopysign-16           2.66          1.18          -55.64%
BenchmarkRound-16              4.82          2.69          -44.19%
BenchmarkSignbit-16            1.71          1.14          -33.33%
BenchmarkFrexp-16              11.4          7.94          -30.35%
BenchmarkLogb-16               10.4          7.34          -29.42%
BenchmarkLdexp-16              15.7          11.2          -28.66%
BenchmarkIlogb-16              10.2          7.32          -28.24%
BenchmarkPowInt-16             69.6          55.9          -19.68%
BenchmarkModf-16               10.1          8.19          -18.91%
BenchmarkLog2-16               17.4          14.3          -17.82%
BenchmarkCbrt-16               45.0          37.3          -17.11%
BenchmarkAtanh-16              57.6          48.3          -16.15%
BenchmarkRemainder-16          76.6          65.4          -14.62%
BenchmarkGamma-16              26.0          22.5          -13.46%
BenchmarkPowFrac-16            197           174           -11.68%
BenchmarkMod-16                112           99.8          -10.89%
BenchmarkAsinh-16              59.9          53.7          -10.35%
BenchmarkAcosh-16              44.8          40.3          -10.04%

Updates #21390

Change-Id: I56cc991fc2e55249d69518d4e1ba76cc23904e35
Reviewed-on: https://go-review.googlesource.com/63290
Reviewed-by: Michael Munday <mike.munday@ibm.com>
2017-09-14 12:14:00 +00:00
Daniel Martí
f351dbfa4d cmd/compile: expand inlining test to multiple pkgs
Rework the test to work with any number of std packages. This was done
to include a few funcs from unicode/utf8. Adding more will be much
simpler too.

While at it, add more runtime funcs by searching for "inlined" or
"inlining" in the git log of its directory. These are: addb, subtractb,
fastrand and noescape.

Updates #21851.

Change-Id: I4fb2bd8aa6a5054218f9b36cb19d897ac533710e
Reviewed-on: https://go-review.googlesource.com/63611
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-14 04:49:58 +00:00
zhongtao.chen
99414a5b1d cmd/compile: limit the number of simultaneously opened files to avoid EMFILE/ENFILE errors
If the Go packages with enough source files,it will cause EMFILE/ENFILE error,
Fix this by limiting the number of simultaneously opened files.

Fixes #21621

Change-Id: I8555d79242d2f90771e37e073b7540fc7194a64a
Reviewed-on: https://go-review.googlesource.com/57751
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-14 04:02:44 +00:00
Matthew Dempsky
c64e793850 cmd/compile: simplify exporting ONAME nodes
These two special cases are unnecessary:

1) "~b%d" references only appear during walk, to handle "return"
statements implicitly assigning to blank result parameters. Even if
they could appear, the "inlined and customized version" accidentally
diverged from p.sym in golang.org/cl/33911.

2) The Vargen case is already identical to the default case, and it
never overlaps with the remaining "T.method" case.

Passes toolstash-check.

Change-Id: I03f7e5b75b707b43afc8ed6eb90f43ba93ed17ae
Reviewed-on: https://go-review.googlesource.com/63272
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-09-13 22:07:35 +00:00
Matthew Dempsky
577967799c cmd/compile: simplify exporting OTYPE nodes
We only export packages that typechecked successfully, and OTYPE nodes
will always have their Type field set.

Changes the package export format, but only in the compiler-specific
section. No version bump necessary.

Change-Id: I722f5827e73948fceb0432bc8b3b22471fea8f61
Reviewed-on: https://go-review.googlesource.com/63273
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-09-13 18:31:16 +00:00
Daniel Martí
0d8a3b208c cmd/compile: add TestIntendedInlining from runtime
Move it from the runtime package, as we will soon add more packages and
functions for it to check.

The test used the testEnv func, which cleaned certain environment
variables from a command, so it was moved to internal/testenv under a
more descriptive (and less ambiguous) name. Add a simple godoc to it
too.

For #21851.

Change-Id: I6f39c1f23b45377718355fafe66ffd87047d8ab6
Reviewed-on: https://go-review.googlesource.com/63550
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
2017-09-13 18:10:31 +00:00
Bryan C. Mills
d02477e994 misc/cgo/errors: port test.bash to Go
This makes the test easier to run in isolation and easier to change,
and simplifies the code to run the tests in parallel.

updates #13467

Change-Id: I5622b5cc98276970347da18e95d071dbca3c5cc1
Reviewed-on: https://go-review.googlesource.com/63276
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-13 17:45:52 +00:00
Martin Möhrmann
1d3ad6733e runtime: refactor hmap.extra.overflow array into two separate fields
This makes it easier to deduce from the field names which overflow
field corresponds to h.buckets and which to h.oldbuckets by aligning
the naming with the buckets fields in hmap.

Change-Id: I8d6a729229a190db0212bac012ead1a3c13cf5d0
Reviewed-on: https://go-review.googlesource.com/62411
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-09-13 06:43:01 +00:00
Wei Xiao
701d49245f cmd/vet: fix go vet on parentheses of assembly function flag
Current implementation doesn't recognize parentheses that may appear in flags
of assembly function as shown below:

	TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$24

It results in vet reporting false positives and a lot of whitelists are added
for suppressing the false alarms.

This CL fixes the issue and eliminates the redundant whitelists.

Change-Id: Idbc1b42965b31cea8ee7c23d1a6f62feb68e844c
Reviewed-on: https://go-review.googlesource.com/62850
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2017-09-13 03:18:07 +00:00
Bryan C. Mills
9f1a7192dc misc/cgo/test: set the traceback level instead of failing the test
Previously, test7978 failed if the user did not invoke it with
GOTRACEBACK=2 already set in their environment. Environment-sensitive
test are awkward, and in this case there is a very simple workaround:
set the traceback level to the necessary value explicitly.

Change-Id: I7d576f24138aa8a41392148eae11bbeaef558573
Reviewed-on: https://go-review.googlesource.com/63275
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-13 02:53:11 +00:00
Daniel Martí
6d33df1d65 cmd/compile: remove redundant switch label
This label was added automatically by grind to remove gotos. As of
today, it's completely useless, as none of its uses need a label to
begin with.

While at it, remove all the redundant breaks too. Leave those that are
the single statement in a case clause body, as that's the style used
throughout std and cmd to clarify when cases are empty.

Change-Id: I3e20068b66b759614e903beab1cc9b2709b31063
Reviewed-on: https://go-review.googlesource.com/62950
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-12 19:39:46 +00:00
Martin Möhrmann
137e4a6c63 cmd/compile: improve single blank variable handling in walkrange
Refactor walkrange to treat "for _ = range a" as "for range a".

This avoids generating some later discarded nodes in the compiler.

Passes toolstash -cmp.

Change-Id: Ifb2e1ca3b8519cbb67e8ad5aad514af9d18f1ec4
Reviewed-on: https://go-review.googlesource.com/61017
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-09-12 05:50:54 +00:00
Lynn Boger
e9cbabb334 cmd/link: enable -buildmode=plugin for ppc64le
This enables support for the buildmode plugin on
ppc64le.

Fixes #20756

Change-Id: I83241ff63f9b5c366fe0496cf46a3f67d75d08ac
Reviewed-on: https://go-review.googlesource.com/55850
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-09-11 21:20:38 +00:00
Daniel Martí
27a70ea560 cmd/compile: simplify a few early var declarations
These were likely written in C or added by an automated tool. Either
way, they're unnecessary now. Clean up the code.

Change-Id: I56de2c7bb60ebab8c500803a8b6586bdf4bf75c7
Reviewed-on: https://go-review.googlesource.com/62951
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-11 21:16:39 +00:00
Lynn Boger
fa3fe2e3c6 cmd/compile, math/bits: add rotate rules to PPC64.rules
This adds rules to match the code in math/bits RotateLeft,
RotateLeft32, and RotateLef64 to allow them to be inlined.

The rules are complicated because the code in these function
use different types, and the non-const version of these
shifts generate Mask and Carry instructions that become
subexpressions during the match process.

Also adds a testcase to asm_test.go.

Improvement in math/bits:

BenchmarkRotateLeft-16       1.57     1.32      -15.92%
BenchmarkRotateLeft32-16     1.60     1.37      -14.37%
BenchmarkRotateLeft64-16     1.57     1.32      -15.92%

Updates #21390

Change-Id: Ib6f17669ecc9cab54f18d690be27e2225ca654a4
Reviewed-on: https://go-review.googlesource.com/59932
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-09-11 20:44:22 +00:00
Joe Tsai
4768408e5f cmd/go: fix regexp
The regular expression "A-za-z" is most likely a typo and
the intent seems to be "A-Za-z" instead.

Using "A-z" matches certain characters like: [\]^_`

Updates #10010

Change-Id: If2d064c56ef613f2e46285d8d4e5998e83aed43a
Reviewed-on: https://go-review.googlesource.com/62910
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
2017-09-11 19:59:43 +00:00
Alan Donovan
7159ab4871 cmd/vet: print: permit '#' flag in %e, %f, and %g
+ Test

Change-Id: I7b42ff70f26a58e1cf58cbbc53d02a65623456ae
Reviewed-on: https://go-review.googlesource.com/62371
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-11 18:11:48 +00:00
Lynn Boger
b74b43de68 cmd/compile: request r12 for indirect calls on ppc64le
On ppc64le, functions compiled with -shared expect r12 to
hold the function's address for indirect calls. Previously
this was enforced by generating a move instruction if the
address wasn't already in r12. This change avoids that extra
move by requesting r12 in the CALL ops that do indirect calls.

As a result of adding support for plugins on ppc64le, it was
discovered that there would be more cases where this extra
move was needed, so this seemed like a better solution.

Updates #20756

Change-Id: I6770885a46990f78c6d2902a715dcdaa822192a1
Reviewed-on: https://go-review.googlesource.com/62890
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-09-11 18:02:33 +00:00
Ben Shi
f727fa7939 cmd/internal/obj/arm: support more ARM VFP instructions
Add support of more ARM VFP instructions in the assembler.
They were introduced in ARM VFPv4.

"FMULAF/FMULAD   Fm, Fn, Fd": Fd = Fd + Fn*Fm
"FNMULAF/FNMULAD Fm, Fn, Fd": Fd = -(Fd + Fn*Fm)
"FMULSF/FMULSD   Fm, Fn, Fd": Fd = Fd - Fn*Fm
"FNMULSF/FNMULSD Fm, Fn, Fd": Fd = -(Fd - Fn*Fm)

The multiplication results are not rounded.

Change-Id: Id9cc52fd8e1b9a708103cd1e514c85a9e1cb3f47
Reviewed-on: https://go-review.googlesource.com/62550
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-11 13:10:50 +00:00
Ben Shi
2899c3e8cb cmd/compile: optimize ARM code with NMULF/NMULD
NMULF and NMULD are efficient FP instructions, and the go compiler can
use them to generate better code.

The benchmark tests of my patch did not show general change, but big
improvement in special cases.

1.A special test case improved 12.6%.
https://github.com/benshi001/ugo1/blob/master/fpmul_test.go
name                     old time/op    new time/op    delta
FPMul-4                     398µs ± 1%     348µs ± 1%  -12.64%  (p=0.000 n=40+40)

2. the compilecmp test showed little change.
name        old time/op       new time/op       delta
Template          2.30s ± 1%        2.31s ± 1%    ~     (p=0.754 n=17+19)
Unicode           1.31s ± 3%        1.32s ± 5%    ~     (p=0.265 n=20+20)
GoTypes           7.73s ± 2%        7.73s ± 1%    ~     (p=0.925 n=20+20)
Compiler          37.0s ± 1%        37.3s ± 2%  +0.79%  (p=0.002 n=19+20)
SSA               83.8s ± 4%        83.5s ± 2%    ~     (p=0.964 n=20+17)
Flate             1.43s ± 2%        1.44s ± 1%    ~     (p=0.602 n=20+20)
GoParser          1.82s ± 2%        1.81s ± 2%    ~     (p=0.141 n=19+20)
Reflect           5.08s ± 2%        5.08s ± 3%    ~     (p=0.835 n=20+19)
Tar               2.36s ± 1%        2.35s ± 1%    ~     (p=0.195 n=18+17)
XML               2.57s ± 2%        2.56s ± 1%    ~     (p=0.283 n=20+17)
[Geo mean]        4.74s             4.75s       +0.05%

name        old user-time/op  new user-time/op  delta
Template          2.75s ± 2%        2.75s ± 0%    ~     (p=0.620 n=20+15)
Unicode           1.59s ± 4%        1.60s ± 4%    ~     (p=0.479 n=20+19)
GoTypes           9.48s ± 1%        9.47s ± 1%    ~     (p=0.743 n=20+20)
Compiler          45.7s ± 1%        45.7s ± 1%    ~     (p=0.482 n=19+20)
SSA                109s ± 1%         109s ± 2%    ~     (p=0.800 n=18+20)
Flate             1.67s ± 3%        1.67s ± 3%    ~     (p=0.598 n=19+18)
GoParser          2.15s ± 4%        2.13s ± 3%    ~     (p=0.153 n=20+20)
Reflect           5.95s ± 2%        5.95s ± 2%    ~     (p=0.961 n=19+20)
Tar               2.93s ± 2%        2.92s ± 3%    ~     (p=0.242 n=20+19)
XML               3.02s ± 3%        3.04s ± 3%    ~     (p=0.233 n=19+18)
[Geo mean]        5.74s             5.74s       -0.04%

name        old text-bytes    new text-bytes    delta
HelloSize         588kB ± 0%        588kB ± 0%    ~     (all equal)

name        old data-bytes    new data-bytes    delta
HelloSize        5.46kB ± 0%       5.46kB ± 0%    ~     (all equal)

name        old bss-bytes     new bss-bytes     delta
HelloSize        72.9kB ± 0%       72.9kB ± 0%    ~     (all equal)

name        old exe-bytes     new exe-bytes     delta
HelloSize        1.03MB ± 0%       1.03MB ± 0%    ~     (all equal)

3. The go1 benchmark showed little change in total.
name                     old time/op    new time/op    delta
BinaryTree17-4              41.8s ± 1%     41.8s ± 1%    ~     (p=0.388 n=40+39)
Fannkuch11-4                24.1s ± 1%     24.1s ± 1%    ~     (p=0.077 n=40+40)
FmtFprintfEmpty-4           834ns ± 1%     831ns ± 1%  -0.31%  (p=0.002 n=40+37)
FmtFprintfString-4         1.34µs ± 1%    1.34µs ± 0%    ~     (p=0.387 n=40+40)
FmtFprintfInt-4            1.44µs ± 1%    1.44µs ± 1%    ~     (p=0.421 n=40+40)
FmtFprintfIntInt-4         2.09µs ± 0%    2.09µs ± 1%    ~     (p=0.589 n=40+39)
FmtFprintfPrefixedInt-4    2.32µs ± 1%    2.33µs ± 1%  +0.15%  (p=0.001 n=40+40)
FmtFprintfFloat-4          4.51µs ± 0%    4.44µs ± 1%  -1.50%  (p=0.000 n=40+40)
FmtManyArgs-4              7.94µs ± 0%    7.97µs ± 0%  +0.36%  (p=0.001 n=32+40)
GobDecode-4                 104ms ± 1%     102ms ± 2%  -1.27%  (p=0.000 n=39+37)
GobEncode-4                90.5ms ± 1%    90.9ms ± 2%  +0.40%  (p=0.006 n=37+40)
Gzip-4                      4.10s ± 2%     4.08s ± 1%  -0.30%  (p=0.004 n=40+40)
Gunzip-4                    603ms ± 0%     602ms ± 1%    ~     (p=0.303 n=37+40)
HTTPClientServer-4          672µs ± 3%     658µs ± 2%  -2.08%  (p=0.000 n=39+37)
JSONEncode-4                238ms ± 1%     239ms ± 0%  +0.26%  (p=0.001 n=40+25)
JSONDecode-4                884ms ± 1%     885ms ± 1%  +0.16%  (p=0.012 n=40+40)
Mandelbrot200-4            49.3ms ± 0%    49.3ms ± 0%    ~     (p=0.588 n=40+38)
GoParse-4                  46.3ms ± 1%    46.4ms ± 2%    ~     (p=0.487 n=40+40)
RegexpMatchEasy0_32-4      1.28µs ± 1%    1.28µs ± 0%  +0.12%  (p=0.003 n=40+40)
RegexpMatchEasy0_1K-4      7.78µs ± 5%    7.78µs ± 4%    ~     (p=0.825 n=40+40)
RegexpMatchEasy1_32-4      1.29µs ± 1%    1.29µs ± 0%    ~     (p=0.659 n=40+40)
RegexpMatchEasy1_1K-4      10.3µs ± 3%    10.4µs ± 2%    ~     (p=0.266 n=40+40)
RegexpMatchMedium_32-4     2.05µs ± 1%    2.05µs ± 0%  -0.18%  (p=0.002 n=40+28)
RegexpMatchMedium_1K-4      533µs ± 1%     534µs ± 1%    ~     (p=0.397 n=37+40)
RegexpMatchHard_32-4       28.9µs ± 1%    28.9µs ± 1%  -0.22%  (p=0.002 n=40+40)
RegexpMatchHard_1K-4        868µs ± 1%     870µs ± 1%  +0.21%  (p=0.015 n=40+40)
Revcomp-4                  67.3ms ± 1%    67.2ms ± 2%    ~     (p=0.262 n=38+39)
Template-4                  1.07s ± 1%     1.07s ± 1%    ~     (p=0.276 n=40+40)
TimeParse-4                7.16µs ± 1%    7.16µs ± 1%    ~     (p=0.610 n=39+40)
TimeFormat-4               13.3µs ± 1%    13.3µs ± 1%    ~     (p=0.617 n=38+40)
[Geo mean]                  720µs          719µs       -0.13%

name                     old speed      new speed      delta
GobDecode-4              7.39MB/s ± 1%  7.49MB/s ± 2%  +1.25%  (p=0.000 n=39+38)
GobEncode-4              8.48MB/s ± 1%  8.45MB/s ± 2%  -0.40%  (p=0.005 n=37+40)
Gzip-4                   4.74MB/s ± 2%  4.75MB/s ± 1%  +0.30%  (p=0.018 n=40+40)
Gunzip-4                 32.2MB/s ± 0%  32.2MB/s ± 1%    ~     (p=0.272 n=36+40)
JSONEncode-4             8.15MB/s ± 1%  8.13MB/s ± 0%  -0.26%  (p=0.003 n=40+25)
JSONDecode-4             2.19MB/s ± 1%  2.19MB/s ± 1%    ~     (p=0.676 n=40+40)
GoParse-4                1.25MB/s ± 2%  1.25MB/s ± 2%    ~     (p=0.823 n=40+40)
RegexpMatchEasy0_32-4    25.1MB/s ± 1%  25.1MB/s ± 0%  -0.12%  (p=0.006 n=40+40)
RegexpMatchEasy0_1K-4     132MB/s ± 5%   132MB/s ± 5%    ~     (p=0.821 n=40+40)
RegexpMatchEasy1_32-4    24.7MB/s ± 1%  24.7MB/s ± 0%    ~     (p=0.630 n=40+40)
RegexpMatchEasy1_1K-4    99.1MB/s ± 3%  98.8MB/s ± 2%    ~     (p=0.268 n=40+40)
RegexpMatchMedium_32-4    487kB/s ± 2%   490kB/s ± 0%  +0.51%  (p=0.001 n=40+40)
RegexpMatchMedium_1K-4   1.92MB/s ± 1%  1.92MB/s ± 1%    ~     (p=0.208 n=39+40)
RegexpMatchHard_32-4     1.11MB/s ± 1%  1.11MB/s ± 0%  +0.36%  (p=0.000 n=40+33)
RegexpMatchHard_1K-4     1.18MB/s ± 1%  1.18MB/s ± 1%    ~     (p=0.207 n=40+37)
Revcomp-4                37.8MB/s ± 1%  37.8MB/s ± 2%    ~     (p=0.276 n=38+39)
Template-4               1.82MB/s ± 1%  1.81MB/s ± 1%    ~     (p=0.122 n=38+40)
[Geo mean]               6.81MB/s       6.81MB/s       +0.06%

fixes #19843

Change-Id: Ief3a0c2b15f59d40c7b40f2784eeb71196685b59
Reviewed-on: https://go-review.googlesource.com/61150
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-11 13:10:33 +00:00
Anthony Sottile
57fa1c7c94 cmd/cgo: treat simple C typedefs as go aliases
Fixes #21809

Change-Id: Ic43077c6bea3c7cdc9611e74abf07b6deab70433
Reviewed-on: https://go-review.googlesource.com/62670
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-11 06:24:15 +00:00
Martin Möhrmann
098126103e cmd/compile: preserve escape information for map literals
While some map literals were marked non-escaping that information
was lost when creating the corresponding OMAKE node which made map
literals always heap allocated.

Copying the escape information to the corresponding OMAKE node allows
stack allocation of hmap and a map bucket for non escaping map literals.

Fixes #21830

Change-Id: Ife0b020fffbc513f1ac009352f2ecb110d6889c9
Reviewed-on: https://go-review.googlesource.com/62790
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-11 05:54:46 +00:00
Hiroshi Ioka
f797e485e0 cmd/link: don't generate runtime.text twice for buildmode=plugin on darwin
https://golang.org/cl/29394 changed to include runtime.text and
runtime.etext in ctxt.Textp as a work around.
But it seems that the CL forgot to change genasmsym.
As a result, we are generating runtime.text and runtime.etext twice.

Change-Id: If7f8faf496c1c489ffa4804da712f91a3d3f4be4
Reviewed-on: https://go-review.googlesource.com/62810
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-11 02:30:05 +00:00
Hiroshi Ioka
410b73728f cmd/link: remove windows-specific kludges from Adddynrel
Adddynrel does nothing on windows. We can make code don't call Adddynrel
on windows in the first place.

Change-Id: I376cc36d44a5df18bda13be57e3916ca3062f181
Reviewed-on: https://go-review.googlesource.com/62611
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-09-10 23:19:52 +00:00
David Crawshaw
753bac3a55 misc/cgo/testplugin: pass GO_GCFLAGS
The noopt builder sets GO_GCFLAGS when building the standard library.
Set it when building plugins to ensure the -shared packages built for it
have the same inlining in the export data (and thus the same package
version).

Tested locally with GO_GCFLAGS="-N -l" ./all.bash

Fixes #17937

Change-Id: Id037cfbf4af744c05c47bdc58eea60a5dba69533
Reviewed-on: https://go-review.googlesource.com/62511
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-10 14:00:18 +00:00
Hiroshi Ioka
1134411a83 cmd/go, cmd/link, cmd/dist: re-enable plugin mode on darwin/amd64
1. remove broken verification
   The runtime check assumes that no-pcln symbol entry have zero value,
   but the linker emit no entries if the symbol is no-pcln.
   As a result, if there are no-pcln symbols at the very end of pcln
   table, it will panic.
2. correct condition of export
   Handle special chracters in pluginpath correcty.
   Export "go.itab.*", so different plugins can share the same itab.

Fixes #18190

Change-Id: Ia4f9c51d83ce8488a9470520f1ee9432802cfc1d
Reviewed-on: https://go-review.googlesource.com/61091
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-10 12:54:13 +00:00
Hiroshi Ioka
1053ae5cf5 cmd/internal/goobj: parse native objects in the archive
Also add HasCGO() to internal/testenv for tests.

Updates #21706

Change-Id: I938188047024052bdb42b3ac1a77708f3c2a6dbb
Reviewed-on: https://go-review.googlesource.com/62591
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-10 12:46:44 +00:00
Hiroshi Ioka
d254c61309 cmd/go: check compiler flags per compilers in gccSupportsFlag
Current code always uses a C compilers for checking compiler flags even
for non-C compilers. This CL solves the issue.

Fixes #21736

Change-Id: I5eaddd5fe7d5df699eb2384518b21e6064ca31cf
Reviewed-on: https://go-review.googlesource.com/61270
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-10 10:12:54 +00:00
Hiroshi Ioka
43807e0f47 cmd/internal/goobj: skip tests on some $GOOS/arm
Updates #21817

Change-Id: I77ffaf8a7e54465a5b73691b896edcb20c29440f
Reviewed-on: https://go-review.googlesource.com/62351
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-10 10:08:55 +00:00
David Crawshaw
06f4d93699 cmd/go: put computed GOROOT in built binaries
As of CL 42533, cmd/go will recompute its GOROOT based on the
location of its own executable. This CL plumbs that computed GOROOT
into every binary it builds using the linker -X flag. This
means binaries built with a moved cmd/go will report the GOROOT
they were built in from runtime.GOROOT().

Fixes #21313

Change-Id: I6c2c559f40f2a0c867ab60cf47c6dbc73ae5e28a
Reviewed-on: https://go-review.googlesource.com/61310
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-09 16:59:35 +00:00
David Crawshaw
4e2ef7f7f9 cmd/go: add source file contents to plugin hash
It is common to have multiple plugins built from ephemeral
source files all with the same name:

	# generate main.go
	go build -buildmode=plugin -o=p1.so main.go
	# rm main.go, generate new main.go
	go build -buildmode=plugin -o=p2.so main.go
	...

These different plugins currently have the same build ID,
and hence the same package path. This means only one can be
loaded.

To remove this restriction, this commit adds the contents of the
main package source files to the plugin hash.

Fixes #19358

Change-Id: Icd42024b085feb29c09c2771aaecb85f8b528dd3
Reviewed-on: https://go-review.googlesource.com/61170
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-09 15:58:20 +00:00
Matthew Dempsky
3d7042fba3 cmd/pack: fix export data truncation bug
The binary export data format includes escaping to prevent "\n$$" from
appearing internally, but not "\n!\n". This could result in a false
positive when cmd/pack searched for "\n!\n" as the delimiter between
package definition and linker object.

To address this, this CL changes cmd/pack to also be aware of the
"\n$$" markers, and to ignore "\n!\n" within the export data.

Fixes #21703.

Change-Id: I71ea8ba49dbd066c7afb7717ddc0190e38fe5649
Reviewed-on: https://go-review.googlesource.com/60773
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-09 14:13:33 +00:00
Marvin Stenger
401609c3ff cmd/dist: move functions for the better
This belongs to a series of clean-up changes (see below) for cmd/dist.
This is change (6).

These changes include:
(1)  apply minor fixes
(2)  restore behavior of branchtag
(3)  unleash bootstrap optimization for windows
(4)  use standard generated code header
(5)  remove trivial variables + functions
(6)  move functions for the better
(7)  simplify code segments
(8)  use bytes.Buffer for code generation
(9)  rename variables + functions
(10) remove doc.go

Change-Id: I1c49e3427079194210a6416057100a7e94a37619
Reviewed-on: https://go-review.googlesource.com/61012
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-09 11:23:41 +00:00
Marvin Stenger
6ea4cfb347 cmd/dist: remove trivial variables + functions
This belongs to a series of clean-up changes (see below) for cmd/dist.
This is change (5).

These changes include:
(1)  apply minor fixes
(2)  restore behavior of branchtag
(3)  unleash bootstrap optimization for windows
(4)  use standard generated code header
(5)  remove trivial variables + functions
(6)  move functions for the better
(7)  simplify code segments
(8)  use bytes.Buffer for code generation
(9)  rename variables + functions
(10) remove doc.go

Change-Id: I0efd1271b6a70bb9248d82f8a4d869556f4a557e
Reviewed-on: https://go-review.googlesource.com/61011
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-09 10:14:25 +00:00
Marvin Stenger
e86c0676cf cmd/dist: use standard generated code header
This belongs to a series of clean-up changes (see below) for cmd/dist.
This is change (4).

These changes include:
(1)  apply minor fixes
(2)  restore behavior of branchtag
(3)  unleash bootstrap optimization for windows
(4)  use standard generated code header
(5)  remove trivial variables + functions
(6)  move functions for the better
(7)  simplify code segments
(8)  use bytes.Buffer for code generation
(9)  rename variables + functions
(10) remove doc.go

Change-Id: I5e163f89a518f074e58bf2d44597e553c918d7e6
Reviewed-on: https://go-review.googlesource.com/61010
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-09 10:13:55 +00:00
Marvin Stenger
fe2f509084 cmd/dist: unleash bootstrap optimization for windows
This belongs to a series of clean-up changes (see below) for cmd/dist.
This is change (3).

These changes include:
(1)  apply minor fixes
(2)  restore behavior of branchtag
(3)  unleash bootstrap optimization for windows
(4)  use standard generated code header
(5)  remove trivial variables + functions
(6)  move functions for the better
(7)  simplify code segments
(8)  use bytes.Buffer for code generation
(9)  rename variables + functions
(10) remove doc.go

Change-Id: I7612bbc3939e6fca3bee4b8e92c528178dd46cd7
Reviewed-on: https://go-review.googlesource.com/61023
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-09 10:13:46 +00:00
Marvin Stenger
b57413d9ca cmd/dist: restore behavior of branchtag
The behavior was changed unintentionally during the conversion from C to Go.
Reviewed-on: https://go-review.googlesource.com/2470

This belongs to a series of clean-up changes (see below) for cmd/dist.
This is change (2).

These changes include:
(1)  apply minor fixes
(2)  restore behavior of branchtag
(3)  unleash bootstrap optimization for windows
(4)  use standard generated code header
(5)  remove trivial variables + functions
(6)  move functions for the better
(7)  simplify code segments
(8)  use bytes.Buffer for code generation
(9)  rename variables + functions
(10) remove doc.go

Change-Id: I53373c7211b35ed68da485c55e510871bfb81267
Reviewed-on: https://go-review.googlesource.com/61022
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-09 10:13:38 +00:00
Marvin Stenger
e27c6c390c cmd/dist: apply minor fixes
This belongs to a series of clean-up changes (see below) for cmd/dist.
This is change (1).

These changes include:
(1)  apply minor fixes
(2)  restore behavior of branchtag
(3)  unleash bootstrap optimization for windows
(4)  use standard generated code header
(5)  remove trivial variables + functions
(6)  move functions for the better
(7)  simplify code segments
(8)  use bytes.Buffer for code generation
(9)  rename variables + functions
(10) remove doc.go

Change-Id: I49e5f2a9b6146e2b60a067da5bac31434ffc9aaf
Reviewed-on: https://go-review.googlesource.com/60650
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-09 10:13:29 +00:00
Hiroshi Ioka
f58c48f834 cmd/link: extract windows-specific code from dynrelocsym
No functional changes.

Change-Id: Ib31bb3f01b515aac6428ec61e0ef02b269623890
Reviewed-on: https://go-review.googlesource.com/62470
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-09 07:06:23 +00:00
Matthew Dempsky
b65cffdcd8 cmd/compile: slightly more idiomatic println code
Updates #21808.

Change-Id: I0314426afcfeed17b1111040110d7f2b0e209526
Reviewed-on: https://go-review.googlesource.com/62430
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-08 23:58:57 +00:00
Keith Randall
02deb77f6d cmd/compile: fix println()
println with no arguments accidentally doesn't print a newline.

Introduced at CL 55097

Fixes #21808

Change-Id: I9fc7b4271b9b31e4c9b6078f055195dc3907b62c
Reviewed-on: https://go-review.googlesource.com/62390
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-08 20:10:48 +00:00
Hiroshi Ioka
87dae58662 cmd/internal/goobj: add tests
Change-Id: I4a0fe1c8625e7e9adfd84ac6910da83d0268f928
Reviewed-on: https://go-review.googlesource.com/60130
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-08 17:40:33 +00:00
Michael Munday
9da29b687f cmd/compile: propagate constants through math.Float{32,64}{,from}bits
This CL adds generic SSA rules to propagate constants through raw bits
conversions between floats and integers. This allows constants to
propagate through some math functions. For example, math.Copysign(0, -1)
is now constant folded to a load of -0.0.

Requires a fix to the ARM assembler which loaded -0.0 as +0.0.

Change-Id: I52649a4691077c7414f19d17bb599a6743c23ac2
Reviewed-on: https://go-review.googlesource.com/62250
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-09-08 17:24:03 +00:00
Hiroshi Ioka
4439b21d0c cmd/go: don't write file if -n option is given
Change-Id: I01f5d3b4748d0ead8642ff3e53d1ae9c4378bcbc
Reviewed-on: https://go-review.googlesource.com/61111
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-08 15:54:15 +00:00
isharipo
5b043abe12 cmd/asm: restrict x86 shift ops to 8bit args
Change "yshl" and "yshb" immediate oclass from Yi32 to Yu8.
This forbids:
- negative shift counts
- shift counts that not fit into 8bit

Affects:
  RCL{B,L,Q,W}
  RCR{B,L,Q,W}
  ROL{B,L,Q,W}
  ROR{B,L,Q,W}
  SAL{B,L,Q,W}
  SAR{B,L,Q,W}
  SHL{B,L,Q,W}
  SHR{B,L,Q,W}

Issue #21528 has some additional context about this change.

Change-Id: I60884cb2b41a860820889fcd878ca6f564006b4a
Reviewed-on: https://go-review.googlesource.com/62190
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-09-07 20:04:48 +00:00
Daniel Martí
38ad33088c cmd/vet: remove two unused parameters and simplify
The isStar and directory function parameters have been unused ever since
they were introduced. Remove them.

While at it, apply some other minor simplifications, such as simplifying
a HasPrefix if and using an early continue to unindent many lines of
code.

Change-Id: I8d57353e9ec10cdb59c5388cf6152ce0ec17bdba
Reviewed-on: https://go-review.googlesource.com/62030
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Marvin Stenger <marvin.stenger94@gmail.com>
2017-09-07 08:26:27 +00:00
Heschi Kreinick
4410900a3c cmd/compile: revert "more compact representation of DW_AT_high_pc"
This reverts commit 84188296e9 AKA CL 60530.

Fixes #21783

Change-Id: I68038a77de7446dea68419a40dd25982ea6d7df5
Reviewed-on: https://go-review.googlesource.com/62151
Reviewed-by: Heschi Kreinick <heschi@google.com>
2017-09-07 02:30:39 +00:00
Matthew Dempsky
13772edbbd cmd/compile: simplify exporting universal 'error' type
There shouldn't be any problems setting error's "Orig" (underlying)
type to a separate anonymous interface, as this is already how
go/types defines it.

Change-Id: I44e9c4048ffe362ce329e8306632e38b5ccfecff
Reviewed-on: https://go-review.googlesource.com/61790
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-09-06 20:14:17 +00:00
Agniva De Sarker
6367c19f26 cmd/internal/obj/x86: add some more AVX2 instructions
This adds the VFMADD[213|231]SD, VFNMADD[213|231]SD,
VADDSD, VSUBSD instructions

This will allow us to write a fast path for exp_amd64.s where
these optimizations can be applied in a lot of places.

Change-Id: Ide292107ab887bd1e225a1ad60880235b5ed7c61
Reviewed-on: https://go-review.googlesource.com/61810
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-06 19:31:18 +00:00
Alessandro Arzilli
31ddd8a39d cmd/compile: more compact DWARF location for locals and arguments
Now that all functions have a DW_AT_frame_base defined we can use
DW_OP_fbreg to specify the location of variables and formal parameters,
instead of the DW_OP_call_frame_cfa/DW_OP_consts/DW_OP_plus, saving 2
bytes for every variable and 2 bytes for every formal parameter after
the first one.

Change-Id: I2c7395b67e4a814a0131ab1520df11ca48ff9327
Reviewed-on: https://go-review.googlesource.com/60550
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2017-09-06 18:33:51 +00:00
Alessandro Arzilli
84188296e9 cmd/compile: more compact representation of DW_AT_high_pc
DWARF version 4 allows DW_AT_high_pc to be represented as a constant
offset from DW_AT_low_pc, this can help save up to 7 bytes per
function/lexical scope.

Change-Id: I93638d83638ecad4d0d1bfe27348eae6139820c9
Reviewed-on: https://go-review.googlesource.com/60530
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2017-09-06 18:12:28 +00:00
isharipo
50f1f639a4 cmd/asm: add most SSE4 missing instructions
Instructions added:
  INSERTPS immb, r/m, xmm
  MPSADBW immb, r/m, xmm
  BLENDPD immb, r/m, xmm
  BLENDPS immb, r/m, xmm
  DPPD immb, r/m, xmm
  DPPS immb, r/m, xmm
  MOVNTDQA r/m, xmm
  PACKUSDW r/m, xmm
  PBLENDW immb, r/m, xmm
  PCMPEQQ r/m, xmm
  PCMPGTQ r/m, xmm
  PCMPISTRI immb, r/m, xmm
  PCMPISTRM immb, r/m, xmm
  PMAXSB r/m, xmm
  PMAXSD r/m, xmm
  PMAXUD r/m, xmm
  PMAXUW r/m, xmm
  PMINSB r/m, xmm
  PMINSD r/m, xmm
  PMINUD r/m, xmm
  PMINUW r/m, xmm
  PTEST r/m, xmm
  PCMPESTRM immb, r/m, xmm

Note: only 'optab' table is extended.

`EXTRACTPS immb, xmm, r/m` is not included in this
change due to new ytab set 'yextractps'. This should simplify
code review.

4-operand instructions are a subject of upcoming changes that
make 4-th (and so on) operands explicit.
Related TODO note in asm6.go:
"dont't hide 4op, some version have xmm version".

Part of the mission to add missing amd64 SSE4 instructions to Go asm.

Change-Id: I71716df14a8a5332e866dd0f0d52d43d7714872f
Reviewed-on: https://go-review.googlesource.com/57470
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
2017-09-06 16:00:54 +00:00
isharipo
b15e8babc8 cmd/asm: add amd64 PALIGNR instruction
3rd change out of 3 to cover AMD64 SSSE3 instruction set in Go asm.
This commit adds instruction that do require new ytab variable.

Change-Id: I0bc7d9401c9176eb3760c3d59494ef082e97af84
Reviewed-on: https://go-review.googlesource.com/56870
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-09-06 15:37:20 +00:00
isharipo
4074e4e5be cmd/asm: add amd64 CLFLUSH instruction
This is the last instruction I found missing in SSE2 set.

It does not reuse 'yprefetch' ytabs due to differences in
operands SRC/DST roles:
- PREFETCHx: ModRM:r/m(r) -> FROM
- CLFLUSH:   ModRM:r/m(w) -> TO

unaryDst map is extended accordingly.

Change-Id: I89e34ebb81cc0ee5f9ebbb1301bad417f7ee437f
Reviewed-on: https://go-review.googlesource.com/56833
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-09-06 15:37:00 +00:00
isharipo
26dadbe32c cmd/asm: add amd64 PAB{SB,SD,SW}, PMADDUBSW, PMULHRSW, PSIG{NB,ND,NW}
instructions

1st change out of 3 to cover AMD64 SSSE3 instruction set in Go asm.
This commit adds instructions that do not require new named ytab sets.

Change-Id: I0c3dfd8d39c3daa8b7683ab163c63145626d042e
Reviewed-on: https://go-review.googlesource.com/56834
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-09-06 15:35:25 +00:00
Martin Möhrmann
6c102e141c cmd/compile: avoid stack allocation of a map bucket for large constant hints
runtime.makemap will allocate map buckets on the heap for hints larger
than the number of elements a single map bucket can hold.

Do not allocate any map bucket on the stack if it is known at compile time
that hint is larger than the number of elements one map bucket can hold.
This avoids zeroing and reserving memory on the stack that will not be used.

Change-Id: I1a5ab853fb16f6a18d67674a77701bf0cf29b550
Reviewed-on: https://go-review.googlesource.com/60450
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-09-06 04:38:12 +00:00
Martin Möhrmann
9c3f268558 cmd/compile: set hiter type for map iterator in order pass
Previously the type was first set to uint8 and then corrected
later in walkrange.

Change-Id: I9e4b597710e8a5fad39dde035df85676bc8d2874
Reviewed-on: https://go-review.googlesource.com/61032
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-09-05 21:00:59 +00:00
Martin Möhrmann
bb31217579 runtime: move map ismapkey check to the compiler
Remove the runtime ismapkey check from makemap and
add a check that the map key type supports comparison
to the hmap construction in the compiler.

Move the ismapkey check for the reflect code path
into reflect_makemap.

Change-Id: I718f79b0670c05b63ef31721e72408f59ec4ae86
Reviewed-on: https://go-review.googlesource.com/61035
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-09-05 20:39:52 +00:00
Matthew Dempsky
0fb82fbcce cmd/compile: remove global bout variable
Change-Id: I7054bbec080708c3a11ed62d7f6594e82aa33747
Reviewed-on: https://go-review.googlesource.com/61691
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
2017-09-05 19:59:21 +00:00
Matthew Dempsky
34db5f0c4d cmd/compile: fix evaluation order for OASOP
Currently, we handle "x op= y" by rewriting as "x = x op y", while
ensuring that any calls or receive operations in 'x' are only
evaluated once. Notably, pointer indirection, indexing operations,
etc. are left alone as it's typically safe to re-evaluate those.

However, those operations were interleaved with evaluating 'y', which
could include function calls that might cause re-evaluation to yield
different memory addresses.

As a fix, simply ensure that we order side-effecting operations in 'y'
before either evaluation of 'x'.

Fixes #21687.

Change-Id: Ib14e77760fda9c828e394e8e362dc9e5319a84b2
Reviewed-on: https://go-review.googlesource.com/60091
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-09-05 18:10:17 +00:00
Matthew Dempsky
d349fa25df cmd/compile: fix and improve struct field reflect information
The previous logic was overly complicated, generated suboptimally
encoded struct type descriptors, and mishandled embeddings of
predeclared universal types.

Fixes #21122.
Fixes #21353.
Fixes #21696.
Fixes #21702.
Updates #21357.

Change-Id: If34761fa6dbe4af2af59dee501e7f30845320376
Reviewed-on: https://go-review.googlesource.com/60410
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-09-05 18:09:41 +00:00
Mark Pulford
812b34efae cmd/compile: ignore non-code nodes when inlining
Avoid counting nodes that don't generate code (eg, constants) against the
inlining budget.

Fixes #21749

Change-Id: I10fca073e64be7d304709ef33e125eb8c78d5e4d
Reviewed-on: https://go-review.googlesource.com/61250
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-04 00:07:33 +00:00
Matthew Dempsky
b2e8630f2f cmd/compile: simplify "missing function body" error message
Fixes #21747.

Change-Id: I6a68370be3b7510ce364ddd1e41a1d767ce3a67f
Reviewed-on: https://go-review.googlesource.com/61311
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-09-03 23:45:15 +00:00
Keith Randall
aed1c119fd cmd/compile: fix assembly test
Bad merge, missed changing to keyed literal structs.

Bug introduced in CL 56252

Change-Id: I55cccff4990bd25e6387f6c90919ee5866900d7f
Reviewed-on: https://go-review.googlesource.com/61290
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-03 16:24:24 +00:00
Cholerae Hu
fb165eaffd cmd/compile: combine x*n - y*n into (x-y)*n
Do the similar thing to CL 55143 to reduce IMUL.

Change-Id: I1bd38f618058e3cd74fac181f003610ea13f2294
Reviewed-on: https://go-review.googlesource.com/56252
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-09-03 14:29:38 +00:00
Ilya Tocar
a4e1a72f0a cmd/compile/internal/amd64: add MOVLloadidx8 and MOVLstoreidx8
Currently we only use 1 and 4 as a scale for indexed 4-byte load.
In code generated in #20711 we can use indexed load with scale=8,
to improve performance:

name  old time/op  new time/op  delta
GM-6   108µs ± 0%    95µs ± 0%  -12.06%  (p=0.000 n=10+10)

So add new ops and combine loadidx1(shift 3..).. into loadidx8,
same for stores.

Change-Id: I5ed1c250ac40960e20606580cf9de221e75b72f1
Reviewed-on: https://go-review.googlesource.com/46134
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-09-01 21:25:25 +00:00
David Crawshaw
605331f43e cmd/go: pass plugin package name to compile -p
When compiling a plugin, package main gets a new name so as not to
conflict with the main package in the host binary, or any other
plugins. It is already defined by cmd/go, and used by cmd/link when
filling out the "" package placeholder in symbols.

With this CL, the plugin-specific name for main is also passed to
cmd/compile's -p flag. This is used to fill out the pkgpath field
of types, and ensures that two types defined in two different plugin
mains with the same name will not be mistaken for one another at
runtime.

Fixes #21386

Change-Id: I8a646d8d7451caff533fe0007343ea8b8e1704ed
Reviewed-on: https://go-review.googlesource.com/60910
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-01 18:27:59 +00:00
Rob Pike
e3f3adedcd cmd/go: document the build flags properly for vet
The "build flags" mentioned in the documentation are only those
that apply to analyzing packages and executing the tool.

Fixes #21711.

Change-Id: Ie7b2a354f1e30c928b40888c51fc68e599a5444a
Reviewed-on: https://go-review.googlesource.com/60830
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-01 04:51:50 +00:00
Hiroshi Ioka
f74b52cf50 cmd/cgo: support large unsigned macro again
The approach of https://golang.org/cl/43476 turned out incorrect.
The problem is that the sniff introduced by the CL only work for simple
expression. And when it fails it fallback to uint64, not int64, which
breaks backward compatibility.
In this CL, we use DWARF for guessing kind instead. That should be more
reliable than previous approach. And importanly, it fallbacks to int64 even
if it fails to guess kind.

Fixes #21708

Change-Id: I39a18cb2efbe4faa9becdcf53d5ac68dba180d46
Reviewed-on: https://go-review.googlesource.com/60510
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-01 00:42:21 +00:00
Joel Sing
51e92d7261 cmd/go: fix clang option handling
On OpenBSD -current, clang is available/installed as 'cc'. This means that
the existing clang check fails and the clang related flags are not enabled.
Fix this by enabling the clang flags if the compiler claims to support them.

Change-Id: I84d124d2409a10f87002c6cbfdb69b4c9a55981a
Reviewed-on: https://go-review.googlesource.com/60750
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-01 00:31:15 +00:00
Heschi Kreinick
37dbfc51b0 cmd/link: emit DW_AT_data_member_location as a constant
Simplify the DWARF representation of structs by emitting field offsets
as constants rather than location descriptions.

This was not explicitly mentioned as an option in DWARF2. It is
mentioned in DWARF4, but isn't listed in the changes, so it's not clear
if this was always intended to work or is an undocumented change. Either
way, it should be valid DWARF4.

Change-Id: Idf7fdd397a21c8f8745673ecc77ef65afa3ffe1c
Reviewed-on: https://go-review.googlesource.com/51611
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-08-31 19:42:23 +00:00
Sam Whited
bf90da97c1 cmd/fix: rewrite x/net/context by default
Since these are type aliases in Go 1.9 make rewriting
golang.org/x/net/context imports to context the default.

Change-Id: Ib7ee58b59ea5463b92e1590c8b8f5c0ef87d310b
Reviewed-on: https://go-review.googlesource.com/58590
Reviewed-by: Sameer Ajmani <sameer@golang.org>
Run-TryBot: Sam Whited <sam@samwhited.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-31 19:04:54 +00:00
Ben Shi
074547a5ce cmd/internal/obj/arm: support more ARM VFP instructions
Add support of more ARM VFP instructions in the assembler.
They were introduced in ARM VFPv2.

"NMULF/NMULD   Fm, Fn, Fd": Fd = -Fn*Fm
"MULAF/MULAD   Fm, Fn, Fd": Fd = Fd + Fn*Fm
"NMULAF/NMULAD Fm, Fn, Fd": Fd = -(Fd + Fn*Fm)
"MULSF/MULSD   Fm, Fn, Fd": Fd = Fd - Fn*Fm
"NMULSF/NMULSD Fm, Fn, Fd": Fd = -(Fd - Fn*Fm)

Change-Id: Icd302676ca44a9f5f153fce734225299403c4163
Reviewed-on: https://go-review.googlesource.com/60170
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-31 13:42:17 +00:00
Cherry Zhang
7846500a5a cmd/compile: remove redundant constant shift rules
Normal shift rules plus constant folding are enough to generate
efficient shift-by-constant instructions.

Add test to make sure we don't generate comparisons for constant
shifts.

TODO: there are still constant shift rules on PPC64. If they
are removed, the constant folding rules are not enough to remove
all the test and mask stuff for constant shifts. Leave them in
for now.

Fixes #20663.

Change-Id: I724cc324aa8607762d0c8aacf9bfa641bda5c2a1
Reviewed-on: https://go-review.googlesource.com/60330
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-08-31 02:08:48 +00:00
Hiroshi Ioka
03876af91c cmd/cgo: support niladic function-like macros
Currently, cgo supports only macros which can be reduced to constants
or variables. The CL addresses remaining parts, macros which can be
represented as niladic functions.

The basic idea is simple:
  1. make a thin wrapper function per macros.
  2. replace macro expansions with function calls.

Fixes #10715
Fixes #18720

Change-Id: I150b4fb48e9dc4cc34466ef6417c04ac93d4bc1a
Reviewed-on: https://go-review.googlesource.com/43970
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-30 18:28:58 +00:00
Ilya Tocar
782ee23884 cmd/compile/internal/ssa: remove redundant zeroextensions on amd64
Some instructions operating on <= 32 bits also zero out upper 32bits.
Remove zeroextensions of such values. Triggers a few times during
all.bash. Also removes ugly code like:
MOVL CX,CX

Change-Id: I66a46c190dd6929b7e3c52f3fe6b967768d00638
Reviewed-on: https://go-review.googlesource.com/58090
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-08-30 16:22:18 +00:00
Ben Shi
64607dbd26 cmd/compile: optimize ARM with MULS
MULS was introduced in ARMv7 and corresponding to MULA. This patch
duplicated all MULA related SSA rules with MULS.

Here was the contrast test result against the original go compiler.
There was no improvement in total, but big improvement in special cases.

1. A specific test case accelerated 18.62%.
(https://github.com/benshi001/ugo1/blob/master/mulsub_test.go)
name                     old time/op    new time/op    delta
MulSub-4                    270µs ± 0%     219µs ± 0%  -18.62%  (p=0.000 n=35+40)

2. Total size of all .a files in pkg/ shrank by 0.002%.

3. The compilecmp benchmark showed no decline.
name        old time/op       new time/op       delta
Template          2.37s ± 3%        2.36s ± 1%    ~     (p=0.233 n=19+18)
Unicode           1.32s ± 2%        1.34s ± 5%  +1.32%  (p=0.011 n=20+18)
GoTypes           7.88s ± 1%        7.87s ± 1%    ~     (p=0.758 n=20+20)
Compiler          37.5s ± 1%        37.6s ± 1%    ~     (p=0.194 n=20+19)
SSA               83.7s ± 2%        83.5s ± 2%    ~     (p=0.569 n=20+19)
Flate             1.46s ± 3%        1.45s ± 1%    ~     (p=0.619 n=20+17)
GoParser          1.87s ± 2%        1.85s ± 1%  -0.58%  (p=0.048 n=20+18)
Reflect           5.10s ± 2%        5.11s ± 2%    ~     (p=0.365 n=19+20)
Tar               1.78s ± 2%        1.78s ± 2%    ~     (p=0.531 n=19+20)
XML               2.62s ± 1%        2.61s ± 2%    ~     (p=0.057 n=17+19)
[Geo mean]        4.68s             4.67s       -0.07%

name        old user-time/op  new user-time/op  delta
Template          2.80s ± 1%        2.79s ± 2%    ~     (p=0.686 n=17+20)
Unicode           1.61s ± 4%        1.63s ± 6%    ~     (p=0.222 n=20+20)
GoTypes           9.59s ± 1%        9.60s ± 1%    ~     (p=0.482 n=17+20)
Compiler          46.1s ± 1%        46.2s ± 1%    ~     (p=0.373 n=20+18)
SSA                108s ± 1%         108s ± 2%    ~     (p=0.784 n=20+20)
Flate             1.68s ± 3%        1.69s ± 3%    ~     (p=0.335 n=20+19)
GoParser          2.20s ± 4%        2.19s ± 2%    ~     (p=0.844 n=20+18)
Reflect           5.97s ± 3%        6.01s ± 2%    ~     (p=0.184 n=20+20)
Tar               2.11s ± 2%        2.11s ± 4%    ~     (p=0.961 n=19+20)
XML               3.07s ± 1%        3.07s ± 3%    ~     (p=0.786 n=16+19)
[Geo mean]        5.61s             5.62s       +0.19%

name        old text-bytes    new text-bytes    delta
HelloSize         586kB ± 0%        586kB ± 0%    ~     (all equal)

name        old data-bytes    new data-bytes    delta
HelloSize        5.46kB ± 0%       5.46kB ± 0%    ~     (all equal)

name        old bss-bytes     new bss-bytes     delta
HelloSize        72.9kB ± 0%       72.9kB ± 0%    ~     (all equal)

name        old exe-bytes     new exe-bytes     delta
HelloSize        1.03MB ± 0%       1.03MB ± 0%    ~     (all equal)

4. The go1 benchmark showed no decline in total.
name                     old time/op    new time/op    delta
BinaryTree17-4              41.7s ± 1%     41.7s ± 1%    ~     (p=0.966 n=40+40)
Fannkuch11-4                23.6s ± 0%     23.6s ± 1%  -0.23%  (p=0.000 n=40+40)
FmtFprintfEmpty-4           844ns ± 1%     834ns ± 1%  -1.23%  (p=0.000 n=40+40)
FmtFprintfString-4         1.39µs ± 1%    1.40µs ± 1%  +0.71%  (p=0.000 n=40+40)
FmtFprintfInt-4            1.44µs ± 1%    1.45µs ± 1%  +0.70%  (p=0.000 n=40+40)
FmtFprintfIntInt-4         2.10µs ± 1%    2.10µs ± 1%  +0.30%  (p=0.000 n=40+40)
FmtFprintfPrefixedInt-4    2.49µs ± 0%    2.50µs ± 1%  +0.66%  (p=0.000 n=32+40)
FmtFprintfFloat-4          4.42µs ± 1%    4.46µs ± 2%  +0.94%  (p=0.000 n=40+40)
FmtManyArgs-4              8.31µs ± 1%    8.22µs ± 1%  -1.09%  (p=0.000 n=40+40)
GobDecode-4                 105ms ± 1%     102ms ± 1%  -2.30%  (p=0.000 n=39+39)
GobEncode-4                90.2ms ± 1%    88.7ms ± 1%  -1.66%  (p=0.000 n=40+39)
Gzip-4                      4.17s ± 1%     4.16s ± 1%    ~     (p=0.785 n=40+40)
Gunzip-4                    608ms ± 1%     608ms ± 1%    ~     (p=0.481 n=40+40)
HTTPClientServer-4          697µs ± 2%     684µs ± 3%  -1.89%  (p=0.000 n=37+40)
JSONEncode-4                255ms ± 1%     256ms ± 1%  +0.35%  (p=0.000 n=40+40)
JSONDecode-4                920ms ± 1%     926ms ± 1%  +0.64%  (p=0.000 n=40+39)
Mandelbrot200-4            49.3ms ± 1%    49.3ms ± 0%  +0.07%  (p=0.005 n=40+40)
GoParse-4                  46.8ms ± 2%    46.7ms ± 1%    ~     (p=1.000 n=40+40)
RegexpMatchEasy0_32-4      1.27µs ± 0%    1.27µs ± 1%    ~     (p=0.057 n=40+40)
RegexpMatchEasy0_1K-4      7.97µs ± 7%    7.92µs ± 5%    ~     (p=0.094 n=40+40)
RegexpMatchEasy1_32-4      1.28µs ± 1%    1.28µs ± 1%    ~     (p=0.406 n=40+40)
RegexpMatchEasy1_1K-4      10.5µs ± 4%    10.5µs ± 3%    ~     (p=0.855 n=40+40)
RegexpMatchMedium_32-4     2.04µs ± 0%    2.04µs ± 1%  -0.22%  (p=0.000 n=39+40)
RegexpMatchMedium_1K-4      541µs ± 0%     540µs ± 1%  -0.25%  (p=0.000 n=40+38)
RegexpMatchHard_32-4       29.3µs ± 1%    29.3µs ± 0%    ~     (p=0.149 n=40+40)
RegexpMatchHard_1K-4        878µs ± 1%     880µs ± 0%  +0.14%  (p=0.005 n=36+35)
Revcomp-4                  81.8ms ± 2%    81.4ms ± 2%  -0.43%  (p=0.015 n=38+39)
Template-4                  1.05s ± 1%     1.05s ± 1%    ~     (p=0.302 n=40+35)
TimeParse-4                7.18µs ± 1%    7.26µs ± 1%  +1.05%  (p=0.000 n=40+36)
TimeFormat-4               13.1µs ± 1%    13.1µs ± 1%    ~     (p=0.698 n=37+40)
[Geo mean]                  733µs          732µs       -0.16%

name                     old speed      new speed      delta
GobDecode-4              7.34MB/s ± 1%  7.51MB/s ± 1%  +2.36%  (p=0.000 n=39+39)
GobEncode-4              8.51MB/s ± 1%  8.65MB/s ± 1%  +1.69%  (p=0.000 n=40+39)
Gzip-4                   4.66MB/s ± 1%  4.66MB/s ± 1%    ~     (p=0.783 n=40+40)
Gunzip-4                 31.9MB/s ± 1%  31.9MB/s ± 1%    ~     (p=0.466 n=40+40)
JSONEncode-4             7.61MB/s ± 1%  7.58MB/s ± 1%  -0.35%  (p=0.001 n=40+40)
JSONDecode-4             2.11MB/s ± 1%  2.10MB/s ± 1%  -0.52%  (p=0.000 n=38+39)
GoParse-4                1.24MB/s ± 2%  1.24MB/s ± 1%    ~     (p=0.556 n=40+39)
RegexpMatchEasy0_32-4    25.1MB/s ± 0%  25.1MB/s ± 1%    ~     (p=0.064 n=40+40)
RegexpMatchEasy0_1K-4     129MB/s ± 8%   129MB/s ± 5%    ~     (p=0.094 n=40+40)
RegexpMatchEasy1_32-4    25.0MB/s ± 1%  25.1MB/s ± 1%    ~     (p=0.331 n=40+40)
RegexpMatchEasy1_1K-4    97.7MB/s ± 4%  97.8MB/s ± 3%    ~     (p=0.851 n=40+40)
RegexpMatchMedium_32-4    490kB/s ± 0%   490kB/s ± 0%    ~     (all equal)
RegexpMatchMedium_1K-4   1.89MB/s ± 0%  1.90MB/s ± 1%  +0.12%  (p=0.031 n=40+40)
RegexpMatchHard_32-4     1.09MB/s ± 1%  1.09MB/s ± 1%    ~     (p=0.597 n=40+40)
RegexpMatchHard_1K-4     1.16MB/s ± 1%  1.16MB/s ± 1%    ~     (p=0.565 n=40+35)
Revcomp-4                31.1MB/s ± 2%  31.2MB/s ± 2%  +0.44%  (p=0.018 n=38+39)
Template-4               1.85MB/s ± 1%  1.85MB/s ± 1%    ~     (p=0.873 n=40+40)
[Geo mean]               6.66MB/s       6.67MB/s       +0.26%

Change-Id: Icc972d8a78ea06c32c3aa15733ff0537c82c2dc7
Reviewed-on: https://go-review.googlesource.com/58950
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
2017-08-30 13:45:08 +00:00
Martin Möhrmann
dcef97e088 cmd/compile: rename mapbucket to bmap
This makes the name of the function to construct the map bucket type
consistent with runtimes naming and the existing hmap function.

Change-Id: If4d8b4a54c92ab914d4adcb96022b48d8b5db631
Reviewed-on: https://go-review.googlesource.com/59915
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-08-30 09:44:34 +00:00
Martin Möhrmann
4c9989a360 cmd/compile: avoid padding for indirect map key or value on amd64p32
Padding needed for map buckets is dependent on the types used to
construct the map bucket. In case of indirect keys or values pointers
are used in the map bucket to the keys or values.

Change the map bucket padding calculation to take the alignment of
the key and value types used to construct the map bucket into account
instead of the original key and value type.

Since pointers are always 32bit aligned on amd64p32 this prevents
adding unneeded padding in case the key or value would have needed
64bit alignment without indirect referencing.

Change-Id: I7943448e882d269b5cff7e921a2a6f3430c50878
Reviewed-on: https://go-review.googlesource.com/60030
Reviewed-by: Keith Randall <khr@golang.org>
2017-08-30 09:02:47 +00:00
Martin Möhrmann
2548d36c86 cmd/compile: simplify check for pointers in map bucket
Change-Id: Ie5e977c54f50274421962a7ca268ae71a6f19cef
Reviewed-on: https://go-review.googlesource.com/60050
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-08-30 07:42:54 +00:00
Martin Möhrmann
54125d191d runtime: move dynamic makemap checks into cmd/compile
Check map invariants, type size and alignments during compile time.

Keep runtime checks for reflect by adding them to reflect_makemap.

Change-Id: Ia28610626591bf7fafb7d5a1ca318da272e54879
Reviewed-on: https://go-review.googlesource.com/59914
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-08-30 07:07:55 +00:00
Alex Brainman
d77d4f509c cmd/link: unexport all peSection fields
Change-Id: I83e168f0d1dd1897a0c02c0f1233e1054e93fb0f
Reviewed-on: https://go-review.googlesource.com/59791
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-30 01:36:22 +00:00
Alex Brainman
3bd79713b7 cmd/link: introduce and use peFile.addDWARF
Change-Id: I2c217e03779772605aa0b5a33ef80459333eeebc
Reviewed-on: https://go-review.googlesource.com/59790
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-30 01:35:29 +00:00
Hiroshi Ioka
0e2cde7c69 cmd/link: refactor container()
* rename to emitPcln because I'd like to skip not only container types,
  but also something like "go.buildid" in the future.
* return bool instead of int.

Change-Id: I029adb81292f7dd2fe98e69f3877c5c27f32ec30
Reviewed-on: https://go-review.googlesource.com/59415
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2017-08-30 01:07:31 +00:00
Ian Lance Taylor
5a7283f146 cmd/link: remove unused SFILE and FileSym
Change-Id: Iec610753052abcf6941a1cd16a9256ee9d689732
Reviewed-on: https://go-review.googlesource.com/59750
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hiroshi Ioka <hirochachacha@gmail.com>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2017-08-29 23:29:45 +00:00
Hiroshi Ioka
1e093043e7 cmd/link: remove dead code
Change-Id: I8a54235c8b7bf1010f19d0d358cd4f76fc911d28
Reviewed-on: https://go-review.googlesource.com/59416
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-29 23:29:24 +00:00