1. 05 Oct, 2019 2 commits
  2. 04 Oct, 2019 23 commits
  3. 03 Oct, 2019 15 commits
    • David Chase's avatar
      cmd/compile: run deadcode before nilcheck for better statement relocation · adc4d2cc
      David Chase authored
      Nilcheck would move statements from NilCheck values to others that
      turned out were already dead, which leads to lost statements.  Better
      to eliminate the dead code first.
      
      One "error" is removed from test/prove.go because the code is
      actually dead, and the additional deadcode pass removes it before
      prove can run.
      
      Change-Id: If75926ca1acbb59c7ab9c8ef14d60a02a0a94f8b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198479
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJeremy Faller <jeremy@golang.org>
      adc4d2cc
    • David Chase's avatar
      cmd/compile: make nilcheck more careful about statement relocations · 08a87938
      David Chase authored
      The earlier code was picking nodes that were "poor choices" and
      thus sometimes losing statements altogether.
      
      Change-Id: Ibe5ed800ffbd3c926c0ab1bc10c77d72d3042e45
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198478
      Run-TryBot: David Chase <drchase@google.com>
      Reviewed-by: default avatarJeremy Faller <jeremy@golang.org>
      08a87938
    • David Chase's avatar
      cmd/compile: classify more nodes as "poor choices" for statements · 53bd9151
      David Chase authored
      Aggregate-making nodes that are later decomposed
      are poor choices for statements, because the decomposition
      phase turns them into multiple sub-values, some of which may be
      dead.  Better to look elsewhere for a statement mark.
      
      Change-Id: Ibd9584138ab3d1384548686896a28580a2e43f54
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198477
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJeremy Faller <jeremy@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      53bd9151
    • David Chase's avatar
      cmd/compile: pick position of implicit break statements more carefully · 6139019e
      David Chase authored
      The previous version used the position of the switch statement,
      which makes for potentially jumpy stepping and introduces a large
      number of statements repeating the line (tricky for inserting
      breaks).  It also shared a single OBREAK node and this was not
      really a syntax "tree".
      
      This improves both the nostmt test (by 6 lines) and
      reduces the total badness score from dwarf-goodness (by about 200).
      
      Change-Id: I1f71b231a26f152bdb6ce9bc8f95828bb222f665
      Reviewed-on: https://go-review.googlesource.com/c/go/+/188218
      Run-TryBot: David Chase <drchase@google.com>
      Reviewed-by: default avatarJeremy Faller <jeremy@golang.org>
      6139019e
    • David Chase's avatar
      cmd/compile: refine statement marking in numberlines · f7f85bdc
      David Chase authored
      1) An empty block is treated as not-a-statement unless its line differs
      from at least one of its predecessors (it might make sense to
      rearrange branches in predecessors, but that is a different issue).
      
      2) When iterating forward to choose a "good" place for a statement,
      actually check that the chosen place is in fact good.
      
      3) Refactor same line and same file into methods on XPos and Pos.
      
      This reduces the failure rate of ssa/stmtlines_test by 7-ish lines.
      (And interacts favorably with later debugging CLs.)
      
      Change-Id: Idb7cca7068f6fc9fbfdbe25bc0da15bcfc7b9d4a
      Reviewed-on: https://go-review.googlesource.com/c/go/+/188217
      Run-TryBot: David Chase <drchase@google.com>
      Reviewed-by: default avatarJeremy Faller <jeremy@golang.org>
      f7f85bdc
    • Matthew Dempsky's avatar
      cmd/compile: change size diagnostic to use benchmark format · 3ad35082
      Matthew Dempsky authored
      Makes it easier to run
      
          go build -a -gcflags=-d=export std |& grep ^BenchmarkExportSize
      
      and get useful output for feeding into benchstat.
      
      Change-Id: I2b52e8f5ff33b7ccb6c25b18e464513344bd9ad9
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198698Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      3ad35082
    • Meng Zhuo's avatar
      internal/bytealg: (re)adding mips64x compare implementation · a1b1ba7d
      Meng Zhuo authored
      The original CL of mips64x compare function has been reverted due to wrong
      implement for little endian.
      Original CL: https://go-review.googlesource.com/c/go/+/196837
      
      name                         old time/op    new time/op    delta
      BytesCompare/1                 28.9ns ± 4%    22.1ns ± 0%    -23.60%  (p=0.000 n=9+8)
      BytesCompare/2                 34.6ns ± 0%    23.1ns ± 0%    -33.25%  (p=0.000 n=8+10)
      BytesCompare/4                 54.6ns ± 0%    40.8ns ± 0%    -25.27%  (p=0.000 n=8+8)
      BytesCompare/8                 73.9ns ± 0%    49.1ns ± 0%    -33.56%  (p=0.000 n=8+8)
      BytesCompare/16                 113ns ± 0%      24ns ± 0%    -79.20%  (p=0.000 n=9+9)
      BytesCompare/32                 190ns ± 0%      26ns ± 0%    -86.53%  (p=0.000 n=10+10)
      BytesCompare/64                 345ns ± 0%      44ns ± 0%    -87.19%  (p=0.000 n=10+8)
      BytesCompare/128                654ns ± 0%      52ns ± 0%    -91.97%  (p=0.000 n=9+8)
      BytesCompare/256               1.27µs ± 0%    0.07µs ± 0%    -94.14%  (p=0.001 n=8+9)
      BytesCompare/512               2.51µs ± 0%    0.12µs ± 0%    -95.26%  (p=0.000 n=9+10)
      BytesCompare/1024              4.99µs ± 0%    0.21µs ± 0%    -95.85%  (p=0.000 n=8+10)
      BytesCompare/2048              9.94µs ± 0%    0.38µs ± 0%    -96.14%  (p=0.000 n=8+8)
      CompareBytesEqual               105ns ± 0%      64ns ± 0%    -39.43%  (p=0.000 n=10+9)
      CompareBytesToNil              34.8ns ± 1%    38.6ns ± 3%    +11.01%  (p=0.000 n=10+10)
      CompareBytesEmpty              33.6ns ± 3%    36.6ns ± 0%     +8.77%  (p=0.000 n=10+8)
      CompareBytesIdentical          29.7ns ± 0%    40.5ns ± 1%    +36.45%  (p=0.000 n=10+8)
      CompareBytesSameLength         69.1ns ± 0%    51.8ns ± 0%    -25.04%  (p=0.000 n=10+9)
      CompareBytesDifferentLength    69.8ns ± 0%    52.5ns ± 0%    -24.79%  (p=0.000 n=10+8)
      CompareBytesBigUnaligned       5.15ms ± 0%    2.19ms ± 0%    -57.59%  (p=0.000 n=9+9)
      CompareBytesBig                5.28ms ± 0%    0.28ms ± 0%    -94.64%  (p=0.000 n=8+8)
      CompareBytesBigIdentical       29.7ns ± 0%    36.9ns ± 2%    +24.11%  (p=0.000 n=8+10)
      
      name                         old speed      new speed      delta
      CompareBytesBigUnaligned      204MB/s ± 0%   480MB/s ± 0%   +135.77%  (p=0.000 n=9+9)
      CompareBytesBig               198MB/s ± 0%  3704MB/s ± 0%  +1765.97%  (p=0.000 n=8+8)
      CompareBytesBigIdentical     35.3TB/s ± 0%  28.4TB/s ± 2%    -19.44%  (p=0.000 n=8+10)
      
      Fixes #34549
      
      Change-Id: I2ef29f13cdd4229745ac2d018bb53c76f2ff1209
      Reviewed-on: https://go-review.googlesource.com/c/go/+/197557Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a1b1ba7d
    • Meng Zhuo's avatar
      cmd/asm: add VLD[1-4]R vector instructions on arm64 · 2bf7a925
      Meng Zhuo authored
      This change adds VLD1R, VLD2R, VLD3R, VLD4R
      
      Change-Id: Ie19e9ae02fdfc94b9344acde8c9938849efb0bf0
      Reviewed-on: https://go-review.googlesource.com/c/go/+/181697
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      2bf7a925
    • Bryan C. Mills's avatar
      Revert "cmd/compile: walk the progs to generate debug_lines" · 5fe3b49a
      Bryan C. Mills authored
      This reverts CL 196661.
      
      Reason for revert: broke TestGdb* tests on mips64le, ppc64le, and s390x builders.
      
      Change-Id: I3b5c97c840819a0d407b943f7cf7e2d97f06042d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198697
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      5fe3b49a
    • Matthew Dempsky's avatar
      cmd/compile: don't statically copy string-typed variables · c33d45a8
      Matthew Dempsky authored
      During package initialization, the compiler tries to optimize:
      
          var A = "foo"
          var B = A
      
      into
      
          var A = "foo"
          var B = "foo"
      
      so that we can statically initialize both A and B and skip emitting
      dynamic initialization code to assign "B = A".
      
      However, this isn't safe in the presence of cmd/link's -X flag, which
      might overwrite an initialized string-typed variable at link time. In
      particular, if cmd/link changes A's static initialization, it won't
      know it also needs to change B's static initialization.
      
      To address this, this CL disables this optimization for string-typed
      variables.
      
      Fixes #34675.
      
      Change-Id: I1c18f3b855f6d7114aeb39f96aaaf1b452b88236
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198657
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarCuong Manh Le <cuong.manhle.vn@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      c33d45a8
    • Jason A. Donenfeld's avatar
      runtime: iterate ms via allm linked list to avoid race · 6b85fa80
      Jason A. Donenfeld authored
      It's pointless to reach all ms via allgs, and doing so introduces a
      race, since the m member of a g can change underneath it. Instead
      iterate directly through the allm linked list.
      
      Updates: #31528
      Updates: #34130
      
      Change-Id: I34b88402b44339b0a5b4cd76eafd0ce6e43e2be1
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198417
      Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
      Reviewed-by: default avatarAlex Brainman <alex.brainman@gmail.com>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      6b85fa80
    • Jeremy Faller's avatar
      cmd/compile: walk the progs to generate debug_lines · 9e6a84f2
      Jeremy Faller authored
      Rather than use the pcln tables, walk progs while generating
      debug_lines.  This code slightly increases the number of is_stmt toggles
      in the debug information due to a previous bug in how the pcline walking
      worked. (Previous versions of the line walking code wouldn't return the
      old_value, instead returning 0. This behavior might lose is_stmt toggles
      in the line table.)
      
      We suspected there would be a speedup with this change, but benchmarking
      hasn't shown this to be true (but has been noisy enough to not really
      show any large differences either way). These benchmarks are comparing
      non-prog walking code with this prog-walking code:
      
      name                      old time/op       new time/op       delta
      Template                        321ms ± 4%        316ms ± 3%     ~     (p=0.165 n=10+10)
      Unicode                         146ms ± 5%        142ms ± 4%     ~     (p=0.063 n=10+10)
      GoTypes                         1.06s ± 2%        1.07s ± 2%     ~     (p=0.280 n=10+10)
      Compiler                        4.07s ± 1%        4.06s ± 1%     ~     (p=0.549 n=10+9)
      SSA                             12.6s ± 2%        12.7s ± 2%   +1.27%  (p=0.019 n=10+10)
      Flate                           201ms ± 7%        202ms ± 4%     ~     (p=0.436 n=10+10)
      GoParser                        248ms ± 4%        250ms ± 2%     ~     (p=0.356 n=9+10)
      Reflect                         679ms ± 5%        678ms ± 4%     ~     (p=0.971 n=10+10)
      Tar                             281ms ± 2%        283ms ± 3%     ~     (p=0.222 n=9+9)
      XML                             381ms ± 3%        384ms ± 5%     ~     (p=0.393 n=10+10)
      LinkCompiler                    1.08s ± 2%        1.10s ± 2%   +1.89%  (p=0.009 n=10+10)
      ExternalLinkCompiler            2.23s ± 4%        2.23s ± 1%     ~     (p=1.000 n=10+8)
      LinkWithoutDebugCompiler        654ms ± 4%        673ms ± 4%   +2.94%  (p=0.019 n=10+10)
      StdCmd                          13.6s ± 2%        13.9s ± 1%   +2.00%  (p=0.000 n=10+10)
      
      name                      old user-time/op  new user-time/op  delta
      Template                        582ms ±11%        575ms ±14%     ~     (p=0.631 n=10+10)
      Unicode                         431ms ±24%        390ms ±38%     ~     (p=0.315 n=10+10)
      GoTypes                         2.47s ±11%        2.51s ± 4%     ~     (p=0.280 n=10+10)
      Compiler                        9.09s ± 3%        9.04s ± 5%     ~     (p=0.684 n=10+10)
      SSA                             25.8s ± 4%        26.0s ± 3%     ~     (p=0.529 n=10+10)
      Flate                           318ms ±14%        322ms ±13%     ~     (p=0.912 n=10+10)
      GoParser                        386ms ± 6%        386ms ± 5%     ~     (p=0.888 n=9+8)
      Reflect                         1.42s ±20%        1.32s ±24%     ~     (p=0.393 n=10+10)
      Tar                             476ms ±19%        471ms ±25%     ~     (p=1.000 n=10+10)
      XML                             681ms ±25%        745ms ±21%     ~     (p=0.143 n=10+10)
      LinkCompiler                    1.75s ±13%        1.86s ±12%     ~     (p=0.075 n=10+10)
      ExternalLinkCompiler            2.98s ±18%        3.41s ±13%  +14.48%  (p=0.003 n=10+10)
      LinkWithoutDebugCompiler        1.05s ±12%        1.08s ±16%     ~     (p=0.739 n=10+10)
      
      name                      old alloc/op      new alloc/op      delta
      Template                       36.4MB ± 0%       36.4MB ± 0%   -0.11%  (p=0.000 n=10+10)
      Unicode                        28.6MB ± 0%       28.5MB ± 0%   -0.06%  (p=0.029 n=10+10)
      GoTypes                         121MB ± 0%        121MB ± 0%   -0.09%  (p=0.000 n=9+9)
      Compiler                        548MB ± 0%        547MB ± 0%   -0.10%  (p=0.000 n=10+10)
      SSA                            1.87GB ± 0%       1.87GB ± 0%   -0.13%  (p=0.000 n=10+10)
      Flate                          23.0MB ± 0%       22.9MB ± 0%   -0.09%  (p=0.000 n=9+10)
      GoParser                       27.9MB ± 0%       27.8MB ± 0%   -0.12%  (p=0.000 n=10+10)
      Reflect                        77.7MB ± 0%       77.6MB ± 0%   -0.12%  (p=0.000 n=8+10)
      Tar                            34.5MB ± 0%       34.5MB ± 0%   -0.07%  (p=0.003 n=10+10)
      XML                            44.4MB ± 0%       44.4MB ± 0%   -0.07%  (p=0.000 n=10+10)
      LinkCompiler                    236MB ± 0%        240MB ± 0%   +1.72%  (p=0.000 n=10+10)
      ExternalLinkCompiler            246MB ± 0%        254MB ± 0%   +3.02%  (p=0.000 n=10+10)
      LinkWithoutDebugCompiler        159MB ± 0%        164MB ± 0%   +3.35%  (p=0.000 n=10+10)
      
      name                      old allocs/op     new allocs/op     delta
      Template                         372k ± 0%         371k ± 0%   -0.23%  (p=0.000 n=10+10)
      Unicode                          340k ± 0%         340k ± 0%   -0.05%  (p=0.000 n=10+10)
      GoTypes                         1.33M ± 0%        1.32M ± 0%   -0.20%  (p=0.000 n=9+10)
      Compiler                        5.37M ± 0%        5.36M ± 0%   -0.17%  (p=0.000 n=10+10)
      SSA                             17.9M ± 0%        17.9M ± 0%   -0.15%  (p=0.000 n=10+10)
      Flate                            234k ± 0%         233k ± 0%   -0.24%  (p=0.000 n=9+10)
      GoParser                         309k ± 0%         309k ± 0%   -0.21%  (p=0.000 n=10+10)
      Reflect                          969k ± 0%         966k ± 0%   -0.30%  (p=0.000 n=9+10)
      Tar                              348k ± 0%         347k ± 0%   -0.22%  (p=0.000 n=10+9)
      XML                              426k ± 0%         425k ± 0%   -0.15%  (p=0.000 n=9+10)
      LinkCompiler                     638k ± 0%         637k ± 0%   -0.07%  (p=0.000 n=10+10)
      ExternalLinkCompiler            1.69M ± 0%        1.69M ± 0%   -0.05%  (p=0.000 n=10+10)
      LinkWithoutDebugCompiler         222k ± 0%         221k ± 0%   -0.03%  (p=0.007 n=10+9)
      
      name                      old object-bytes  new object-bytes  delta
      Template                        559kB ± 0%        560kB ± 0%   +0.23%  (p=0.000 n=10+10)
      Unicode                         216kB ± 0%        216kB ± 0%   +0.01%  (p=0.000 n=10+10)
      GoTypes                        2.03MB ± 0%       2.04MB ± 0%   +0.31%  (p=0.000 n=10+10)
      Compiler                       8.07MB ± 0%       8.10MB ± 0%   +0.35%  (p=0.000 n=10+10)
      SSA                            27.1MB ± 0%       27.3MB ± 0%   +0.72%  (p=0.000 n=10+10)
      Flate                           343kB ± 0%        344kB ± 0%   +0.22%  (p=0.000 n=10+10)
      GoParser                        441kB ± 0%        442kB ± 0%   +0.34%  (p=0.000 n=10+10)
      Reflect                        1.36MB ± 0%       1.36MB ± 0%   +0.23%  (p=0.000 n=10+10)
      Tar                             487kB ± 0%        488kB ± 0%   +0.21%  (p=0.000 n=10+10)
      XML                             632kB ± 0%        634kB ± 0%   +0.35%  (p=0.000 n=10+10)
      
      name                      old export-bytes  new export-bytes  delta
      Template                       18.5kB ± 0%       18.5kB ± 0%     ~     (all equal)
      Unicode                        7.92kB ± 0%       7.92kB ± 0%     ~     (all equal)
      GoTypes                        35.0kB ± 0%       35.0kB ± 0%     ~     (all equal)
      Compiler                        109kB ± 0%        109kB ± 0%   +0.00%  (p=0.000 n=10+10)
      SSA                             137kB ± 0%        137kB ± 0%   +0.00%  (p=0.000 n=10+10)
      Flate                          4.89kB ± 0%       4.89kB ± 0%     ~     (all equal)
      GoParser                       8.49kB ± 0%       8.49kB ± 0%     ~     (all equal)
      Reflect                        11.4kB ± 0%       11.4kB ± 0%     ~     (all equal)
      Tar                            10.5kB ± 0%       10.5kB ± 0%     ~     (all equal)
      XML                            16.7kB ± 0%       16.7kB ± 0%     ~     (all equal)
      
      name                      old text-bytes    new text-bytes    delta
      HelloSize                       760kB ± 0%        760kB ± 0%     ~     (all equal)
      CmdGoSize                      10.8MB ± 0%       10.8MB ± 0%     ~     (all equal)
      
      name                      old data-bytes    new data-bytes    delta
      HelloSize                      10.7kB ± 0%       10.7kB ± 0%     ~     (all equal)
      CmdGoSize                       312kB ± 0%        312kB ± 0%     ~     (all equal)
      
      name                      old bss-bytes     new bss-bytes     delta
      HelloSize                       122kB ± 0%        122kB ± 0%     ~     (all equal)
      CmdGoSize                       146kB ± 0%        146kB ± 0%     ~     (all equal)
      
      name                      old exe-bytes     new exe-bytes     delta
      HelloSize                      1.13MB ± 0%       1.13MB ± 0%     ~     (all equal)
      CmdGoSize                      15.0MB ± 0%       15.1MB ± 0%   +0.22%  (p=0.000 n=10+10)
      
      Change-Id: If6e0982cd1398062a88e6c0c7513e141f9503531
      Reviewed-on: https://go-review.googlesource.com/c/go/+/196661
      Run-TryBot: Jeremy Faller <jeremy@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      9e6a84f2
    • Tobias Klauser's avatar
      cmd/go/internal/modfetch: update TestCodeRepo for gopkg.in/yaml.v2 again · 64785bf9
      Tobias Klauser authored
      Update the expected data to fix the longtest builder.
      
      Updates #28856
      
      Change-Id: I7fb6ee72e8469d974561b4b4057f40142f5b3654
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198557
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDmitri Shuralyov <dmitshur@golang.org>
      64785bf9
    • Utkarsh Dixit's avatar
      C: update email address for utkarsh-extc · 3d437ac6
      Utkarsh Dixit authored
      Change-Id: If657dab2df19d3b0c2ff9869a64e3a97446646ac
      GitHub-Last-Rev: b921b01cf4e5bcbbc65fb1fb0b5cd836bda73596
      GitHub-Pull-Request: golang/go#34637
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198041Reviewed-by: default avatarDmitri Shuralyov <dmitshur@golang.org>
      3d437ac6
    • Robert Griesemer's avatar
      cmd/compile: better error message for language version errors · 27fc32ff
      Robert Griesemer authored
      Fixes #33753.
      Updates #31747.
      
      Change-Id: Icc42b23405ead4f7f17b0ffa3611405454b6b271
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198491
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      27fc32ff