1. 03 Apr, 2017 12 commits
  2. 02 Apr, 2017 1 commit
  3. 01 Apr, 2017 5 commits
  4. 31 Mar, 2017 22 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile: add comment to statictmp name generation · bfeda6cc
      Josh Bleecher Snyder authored
      Follow-up to review comments on CL 39193.
      
      Change-Id: I7649af9d70ad73e039061a7a66fea416a7476192
      Reviewed-on: https://go-review.googlesource.com/39199Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      bfeda6cc
    • Josh Bleecher Snyder's avatar
      cmd/compile: don't mutate shared nodes in orderinit · 8e36575e
      Josh Bleecher Snyder authored
      A few gc.Node ops may be shared across functions.
      The compiler is (mostly) already careful to avoid mutating them.
      However, from a concurrency perspective, replacing (say)
      an empty list with an empty list still counts as a mutation.
      One place this occurs is orderinit. Avoid it.
      
      This requires fixing one spot where shared nodes were mutated.
      It doesn't result in any functional or performance changes.
      
      Passes toolstash-check.
      
      Updates #15756
      
      Change-Id: I63c93b31baeeac62d7574804acb6b7f2bc9d14a9
      Reviewed-on: https://go-review.googlesource.com/39196
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      8e36575e
    • Lynn Boger's avatar
      cmd/compile: improve LoweredMove performance on ppc64x · a8b2e4a6
      Lynn Boger authored
      This change improves the performance for LoweredMove on ppc64le
      and ppc64.
      
      benchmark                   old ns/op     new ns/op     delta
      BenchmarkCopyFat8-16        0.93          0.69          -25.81%
      BenchmarkCopyFat12-16       2.61          1.85          -29.12%
      BenchmarkCopyFat16-16       9.68          1.89          -80.48%
      BenchmarkCopyFat24-16       4.48          1.85          -58.71%
      BenchmarkCopyFat32-16       6.12          1.82          -70.26%
      BenchmarkCopyFat64-16       21.2          2.70          -87.26%
      BenchmarkCopyFat128-16      29.6          3.97          -86.59%
      BenchmarkCopyFat256-16      52.6          13.4          -74.52%
      BenchmarkCopyFat512-16      97.1          18.7          -80.74%
      BenchmarkCopyFat1024-16     186           35.3          -81.02%
      
      BenchmarkAssertE2TLarge-16      14.2          5.06          -64.37%
      
      Fixes #19785
      
      Change-Id: I7d5e0052712b75811c02c7d86c5112e5649ad782
      Reviewed-on: https://go-review.googlesource.com/38950Reviewed-by: default avatarKeith Randall <khr@golang.org>
      a8b2e4a6
    • Russ Cox's avatar
      time: test and fix Time.Round, Duration.Round for d > 2⁶² · 105cc2bd
      Russ Cox authored
      Round uses r+r < d to decide whether the remainder is
      above or below half of d (to decide whether to round up or down).
      This is wrong when r+r wraps negative, because it looks < d
      but is really > d.
      
      No one will ever care about rounding to a multiple of
      d > 2⁶² (about 146 years), but might as well get it right.
      
      Fixes #19807.
      
      Change-Id: I1b55a742dc36e02a7465bc778bf5dd74fe71f7c0
      Reviewed-on: https://go-review.googlesource.com/39151
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarRob Pike <r@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      105cc2bd
    • Josh Bleecher Snyder's avatar
      cmd/compile: use newnamel in typenamesym · 8ab71304
      Josh Bleecher Snyder authored
      The node in typenamesym requires neither
      a position nor a curfn.
      
      Passes toolstash-check.
      
      Updates #15756
      
      Change-Id: I6d39a8961e5578fe5924aaceb29045b6de2699df
      Reviewed-on: https://go-review.googlesource.com/39194
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      8ab71304
    • Josh Bleecher Snyder's avatar
      cmd/compile: use newnamel in ssa.go · 8caf21da
      Josh Bleecher Snyder authored
      For concurrency safety.
      
      Passes toolstash-check.
      
      Updates #15756.
      
      Change-Id: I1caca231a962781ff8f4f589b2e0454d2820ffb6
      Reviewed-on: https://go-review.googlesource.com/39192
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      8caf21da
    • Josh Bleecher Snyder's avatar
      cmd/compile: add newnamel, use in tempAt · 3d90378d
      Josh Bleecher Snyder authored
      newnamel is newname but with no dependency on lineno or Curfn.
      This makes it suitable for use in a concurrent back end.
      Use it now to make tempAt global-free.
      
      The decision to push the assignment to n.Name.Curfn
      to the caller of newnamel is based on mdempsky's
      comments in #19683 that he'd like to do that
      for callers of newname as well.
      
      Passes toolstash-check. No compiler performance impact.
      
      Updates #19683
      Updates #15756
      
      Change-Id: Idc461a1716916d268c9ff323129830d9a6e4a4d9
      Reviewed-on: https://go-review.googlesource.com/39191
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      3d90378d
    • Josh Bleecher Snyder's avatar
      cmd/compile: remove makefuncdatasym_nsym global · 4927b9a9
      Josh Bleecher Snyder authored
      This causes a minor reduction in allocations,
      because the old funcdatasym names were
      being interned unnecessarily.
      
      Updates #15756
      
      name       old alloc/op    new alloc/op    delta
      Template      39.9MB ± 0%     39.9MB ± 0%    ~     (p=0.280 n=10+10)
      Unicode       29.9MB ± 0%     29.8MB ± 0%  -0.26%  (p=0.000 n=10+10)
      GoTypes        113MB ± 0%      113MB ± 0%  -0.12%  (p=0.000 n=10+10)
      SSA            855MB ± 0%      855MB ± 0%  -0.03%  (p=0.001 n=10+10)
      Flate         25.4MB ± 0%     25.3MB ± 0%  -0.30%  (p=0.000 n=10+10)
      GoParser      31.9MB ± 0%     31.8MB ± 0%    ~     (p=0.065 n=10+9)
      Reflect       78.4MB ± 0%     78.2MB ± 0%  -0.15%  (p=0.000 n=9+10)
      Tar           26.7MB ± 0%     26.7MB ± 0%  -0.17%  (p=0.000 n=9+10)
      XML           42.3MB ± 0%     42.4MB ± 0%  +0.07%  (p=0.011 n=10+10)
      
      name       old allocs/op   new allocs/op   delta
      Template        390k ± 0%       390k ± 0%    ~     (p=0.905 n=9+10)
      Unicode         319k ± 1%       319k ± 1%    ~     (p=0.724 n=10+10)
      GoTypes        1.14M ± 0%      1.14M ± 0%    ~     (p=0.393 n=10+10)
      SSA            7.60M ± 0%      7.60M ± 0%    ~     (p=0.604 n=9+10)
      Flate           235k ± 1%       234k ± 1%    ~     (p=0.105 n=10+10)
      GoParser        317k ± 0%       316k ± 1%    ~     (p=0.280 n=10+10)
      Reflect         979k ± 0%       979k ± 0%    ~     (p=0.315 n=10+10)
      Tar             251k ± 0%       251k ± 1%    ~     (p=0.762 n=8+10)
      XML             393k ± 0%       394k ± 1%    ~     (p=0.095 n=9+10)
      
      name       old text-bytes  new text-bytes  delta
      HelloSize       684k ± 0%       684k ± 0%    ~     (all equal)
      
      name       old data-bytes  new data-bytes  delta
      HelloSize       138k ± 0%       138k ± 0%    ~     (all equal)
      
      name       old exe-bytes   new exe-bytes   delta
      HelloSize      1.03M ± 0%      1.03M ± 0%    ~     (all equal)
      
      Change-Id: Idba33da4e89c325984ac46e4852cf12e4a7fd1a9
      Reviewed-on: https://go-review.googlesource.com/39032
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      4927b9a9
    • Josh Bleecher Snyder's avatar
      cmd/compile: clean up methodsym · 2f072a42
      Josh Bleecher Snyder authored
      Convert yyerrors into Fatals.
      Remove the goto.
      Move variable declaration closer to use.
      Unify printing strings a bit.
      Convert an int param into a bool.
      
      Passes toolstash-check. No compiler performance impact.
      
      Change-Id: I9017681417b785cf8693d18b124ac4f1ff37f2b5
      Reviewed-on: https://go-review.googlesource.com/39170
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      2f072a42
    • Josh Bleecher Snyder's avatar
      cmd/compile: don't use lookupN for statictmps · 3237af2d
      Josh Bleecher Snyder authored
      The names never occur more than once,
      so interning the results is counterproductive.
      
      The impact is not very big, but neither is the fix.
      
      name     old time/op     new time/op     delta
      Unicode     90.2ms ± 3%     88.3ms ± 5%  -2.10%  (p=0.000 n=94+98)
      
      
      Change-Id: I1e3a24433db4ae0c9a6e98166568941824ff0779
      Reviewed-on: https://go-review.googlesource.com/39193
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3237af2d
    • Robert Griesemer's avatar
      cmd/compile: use std "DO NOT EDIT" comment for generated files · 9e28ea0c
      Robert Griesemer authored
      Also: Fix (testdata/gen/) copyGen.go, zeroGen.go, and arithConstGen.go
      to actually match (testdata/) copy.go, zero.go, and arithConst.go, all
      of which were manually edited in https://go-review.googlesource.com/20823
      and https://go-review.googlesource.com/22748 despite the 'do not edit'
      (or perhaps because it was missing in the case of arithConst.go).
      
      For #13560.
      
      Change-Id: I366e1b521e51885e0d318ae848760e5e14ccd488
      Reviewed-on: https://go-review.googlesource.com/39172Reviewed-by: default avatarRob Pike <r@golang.org>
      9e28ea0c
    • Josh Bleecher Snyder's avatar
      runtime/race: print output when TestRace parsing fails · 654c977b
      Josh Bleecher Snyder authored
      Change-Id: I986f0c106e059455874692f5bfe2b5af25cf470e
      Reviewed-on: https://go-review.googlesource.com/39090
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      654c977b
    • Josh Bleecher Snyder's avatar
      cmd/compile: catch and report nowritebarrier violations later · 0323895c
      Josh Bleecher Snyder authored
      Prior to this CL, the SSA backend reported violations
      of the //go:nowritebarrier annotation immediately.
      This necessitated emitting errors during SSA compilation,
      which is not compatible with a concurrent backend.
      
      Instead, check for such violations later.
      We already save the data required to do a late check
      for violations of the //go:nowritebarrierrec annotation.
      Use the same data, and check //go:nowritebarrier at the same time.
      
      One downside to doing this is that now only a single
      violation will be reported per function.
      Given that this is for the runtime only,
      and violations are rare, this seems an acceptable cost.
      
      While we are here, remove several 'nerrors != 0' checks
      that are rendered pointless.
      
      Updates #15756
      Fixes #19250 (as much as it ever can be)
      
      Change-Id: Ia44c4ad5b6fd6f804d9f88d9571cec8d23665cb3
      Reviewed-on: https://go-review.googlesource.com/38973
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      0323895c
    • Josh Bleecher Snyder's avatar
      cmd/compile: rework reporting of oversized stack frames · ca33e109
      Josh Bleecher Snyder authored
      We don't support stack frames over 2GB.
      Rather than detect this during backend compilation,
      check for it at the end of compilation.
      This is arguably a more accurate check anyway,
      since it takes into account the full frame,
      including local stack, arguments, and arch-specific
      rounding, although it's unlikely anyone would ever notice.
      
      Also, rather than reporting the error right away,
      take note of it and report it later, at the top level.
      This is not relevant now, but it will help with making
      the backend concurrent, as the append to the list of
      oversized functions can be cheaply protected by a plain mutex.
      
      Updates #15756
      Updates #19250
      
      Change-Id: Id3fa21906616d62e9dc66e27a17fd5f83304e96e
      Reviewed-on: https://go-review.googlesource.com/38972
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      ca33e109
    • Ben Shi's avatar
      cmd/compile/internal: Optimization with RBIT and REV · 8577f81a
      Ben Shi authored
      By checking GOARM in ssa/gen/ARM.rules, each intermediate operator
      can be implemented via different instruction serials.
      
      It is up to the user to choose between compitability and efficiency.
      
      The Bswap32(x) is optimized to REV(x) when GOARM >= 6.
      The CTZ(x) is optimized to CLZ(RBIT x) when GOARM == 7.
      
      Change-Id: Ie9ee645fa39333fa79ad84ed4d1cefac30422814
      Reviewed-on: https://go-review.googlesource.com/35610
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      8577f81a
    • Carlos Eduardo Seo's avatar
      math/big: Unify divWW implementation for ppc64 and ppc64le. · 4a114047
      Carlos Eduardo Seo authored
      Starting in go1.9, the minimum processor requirement for ppc64 is POWER8. So it
      may now use the same divWW implementation as ppc64le.
      
      Updates #19074
      
      Change-Id: If1a85f175cda89eee06a1024ccd468da6124c844
      Reviewed-on: https://go-review.googlesource.com/39010
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarLynn Boger <laboger@linux.vnet.ibm.com>
      4a114047
    • Daniel Theophanes's avatar
      database/sql: support scanning into user defined string types · 5a45a157
      Daniel Theophanes authored
      User defined numeric types such as "type Int int64" have
      been able to be scanned into without a custom scanner by
      using the reflect scan code path used to convert between
      various numeric types. Add in a path for string types
      for symmetry and least surprise.
      
      Fixes #18101
      
      Change-Id: I00553bcf021ffe6d95047eca0067ee94b54ff501
      Reviewed-on: https://go-review.googlesource.com/39031
      Run-TryBot: Daniel Theophanes <kardianos@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      5a45a157
    • Dave Cheney's avatar
      cmd/asm/internal/arch: use generic obj.Rconv function everywhere · bfd8093c
      Dave Cheney authored
      Rather than using arm64.Rconv directly in the archArm64 constructor
      use the generic obj.Rconv helper. This removes the only use of
      arm64.Rconv outside the arm64 package itself.
      
      Change-Id: I99e9e7156b52cd26dc134f610f764ec794264e2c
      Reviewed-on: https://go-review.googlesource.com/38756
      Run-TryBot: Dave Cheney <dave@cheney.net>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      bfd8093c
    • Brad Fitzpatrick's avatar
      syscall: skip test on TestUnshareMountNameSpace permission error · 3e4afe23
      Brad Fitzpatrick authored
      TestUnshareMountNameSpace fails on arm64 due to permission problems.
      
      Skip that test for now when permission problems are encountered, so we
      don't regress elsewhere in the meantime.
      
      Updates #19698
      
      Change-Id: I9058928afa474b813652c9489f343b8957160a6c
      Reviewed-on: https://go-review.googlesource.com/39052
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      3e4afe23
    • Austin Clements's avatar
      runtime: make runtime.GC() trigger a concurrent GC · 9ffbdabd
      Austin Clements authored
      Currently runtime.GC() triggers a STW GC. For common uses in tests and
      benchmarks, it doesn't matter whether it's STW or concurrent, but for
      uses in servers for things like collecting heap profiles and
      controlling memory footprint, this pause can be a bit problem for
      latency.
      
      This changes runtime.GC() to trigger a concurrent GC. In order to
      remain as close as possible to its current meaning, we define it to
      always perform a full mark/sweep GC cycle before returning (even if
      that means it has to finish up a cycle we're in the middle of first)
      and to publish the heap profile as of the triggered mark termination.
      While it must perform a full cycle, simultaneous runtime.GC() calls
      can be consolidated into a single full cycle.
      
      Fixes #18216.
      
      Change-Id: I9088cc5deef4ab6bcf0245ed1982a852a01c44b5
      Reviewed-on: https://go-review.googlesource.com/37520
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      9ffbdabd
    • Austin Clements's avatar
      runtime: track the number of active sweepone calls · 44ed88a5
      Austin Clements authored
      sweepone returns ^uintptr(0) when there are no more spans to *start*
      sweeping, but there may be spans being swept concurrently at the time
      and there's currently no efficient way to tell when the sweeper is
      done sweeping all the spans.
      
      We'll need this for concurrent runtime.GC(), so add a count of the
      number of active sweepone calls to make it possible to block until
      sweeping is truly done.
      
      This is also useful for more accurately printing the gcpacertrace,
      since that should be printed after all of the sweeping stats are in
      (currently we can print it slightly too early).
      
      For #18216.
      
      Change-Id: I06e6240c9e7b40aca6fd7b788bb6962107c10a0f
      Reviewed-on: https://go-review.googlesource.com/37716
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      44ed88a5
    • Austin Clements's avatar
      runtime: don't adjust GC trigger on forced GC · 2919132e
      Austin Clements authored
      Forced GCs don't provide good information about how to adjust the GC
      trigger. Currently we avoid adjusting the trigger on forced GC because
      forced GC is also STW and we don't adjust the trigger on STW GC.
      However, this will become a problem when forced GC is concurrent.
      
      Fix this by skipping trigger adjustment if the GC was user-forced.
      
      For #18216.
      
      Change-Id: I03dfdad12ecd3cfeca4573140a0768abb29aac5e
      Reviewed-on: https://go-review.googlesource.com/38951
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      2919132e