1. 20 Mar, 2017 5 commits
  2. 19 Mar, 2017 9 commits
    • Austin Clements's avatar
      runtime: disallow malloc or panic in scavenge · df6025bc
      Austin Clements authored
      Mallocs and panics in the scavenge path are particularly nasty because
      they're likely to silently self-deadlock on the mheap.lock. Avoid
      sinking lots of time into debugging these issues in the future by
      turning these into immediate throws.
      
      Change-Id: Ib36fdda33bc90b21c32432b03561630c1f3c69bc
      Reviewed-on: https://go-review.googlesource.com/38293
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      df6025bc
    • Austin Clements's avatar
      runtime: introduce a type for lfstacks · 13ae271d
      Austin Clements authored
      The lfstack API is still a C-style API: lfstacks all have unhelpful
      type uint64 and the APIs are package-level functions. Make the code
      more readable and Go-style by creating an lfstack type with methods
      for push, pop, and empty.
      
      Change-Id: I64685fa3be0e82ae2d1a782a452a50974440a827
      Reviewed-on: https://go-review.googlesource.com/38290
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      13ae271d
    • Martin Möhrmann's avatar
      cmd/compile: replace all uses of ptrto by typPtr · 2805d206
      Martin Möhrmann authored
      This makes the overall naming and use of the functions
      to create a Type more consistent.
      
      Passes toolstash -cmp.
      
      Change-Id: Ie0d40b42cc32b5ecf5f20502675a225038ea40e4
      Reviewed-on: https://go-review.googlesource.com/38354Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2805d206
    • Martin Möhrmann's avatar
      cmd/compile: reduce allocs when appending to Node slices · 00f4cacb
      Martin Möhrmann authored
      Rewrite Append function such that the *Node slice argument does not escape.
      
      Passes toolstash -cmp.
      
      name      old alloc/op    new alloc/op    delta
      Template     40.8MB ± 0%     40.8MB ± 0%  -0.17%  (p=0.000 n=20+19)
      Unicode      30.3MB ± 0%     30.2MB ± 0%  -0.11%  (p=0.000 n=19+20)
      GoTypes       115MB ± 0%      115MB ± 0%  -0.20%  (p=0.000 n=20+20)
      Compiler      492MB ± 0%      491MB ± 0%  -0.25%  (p=0.000 n=20+20)
      SSA           858MB ± 0%      858MB ± 0%  -0.08%  (p=0.000 n=20+20)
      Flate        26.2MB ± 0%     26.2MB ± 0%  -0.13%  (p=0.000 n=20+19)
      GoParser     32.5MB ± 0%     32.4MB ± 0%  -0.14%  (p=0.000 n=20+20)
      Reflect      80.6MB ± 0%     80.4MB ± 0%  -0.27%  (p=0.000 n=20+20)
      Tar          27.3MB ± 0%     27.3MB ± 0%  -0.12%  (p=0.000 n=20+19)
      XML          43.1MB ± 0%     43.0MB ± 0%  -0.14%  (p=0.000 n=20+20)
      
      name      old allocs/op   new allocs/op   delta
      Template       400k ± 1%       397k ± 0%  -0.81%  (p=0.000 n=20+18)
      Unicode        321k ± 1%       320k ± 0%  -0.43%  (p=0.000 n=20+20)
      GoTypes       1.17M ± 0%      1.16M ± 0%  -0.89%  (p=0.000 n=20+20)
      Compiler      4.59M ± 0%      4.54M ± 0%  -1.26%  (p=0.000 n=20+19)
      SSA           7.68M ± 0%      7.65M ± 0%  -0.37%  (p=0.000 n=18+18)
      Flate          242k ± 1%       240k ± 1%  -0.70%  (p=0.000 n=20+20)
      GoParser       323k ± 1%       321k ± 1%  -0.64%  (p=0.000 n=20+20)
      Reflect       1.01M ± 0%      1.00M ± 0%  -0.92%  (p=0.000 n=20+19)
      Tar            258k ± 1%       256k ± 1%  -0.60%  (p=0.000 n=20+19)
      XML            403k ± 1%       400k ± 0%  -0.78%  (p=0.000 n=20+20)
      
      Change-Id: Ie1eb603dc46f729574f6a76c08085b2619249be4
      Reviewed-on: https://go-review.googlesource.com/37437Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      00f4cacb
    • Michel Lespinasse's avatar
      cmd/pprof: use proxy from environment · 81bcc470
      Michel Lespinasse authored
      See #18736
      
      Change-Id: I9c16357c05c16db677125d3077ee466b71559c7a
      Reviewed-on: https://go-review.googlesource.com/38343Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      81bcc470
    • Josh Bleecher Snyder's avatar
      cmd/compile: clean up SSA test API · a68e5d94
      Josh Bleecher Snyder authored
      I noted in CL 38327 that the SSA test API felt a bit
      clunky after the ssa.Func/ssa.Cache/ssa.Config refactoring,
      and promised to clean it up once the dust settled.
      The dust has settled.
      
      Along the way, this CL fixes a potential latent bug,
      in which the amd64 test context was used for all dummy Syslook calls.
      The lone SSA test using the s390x context did not depend on the
      Syslook context being correct, so the bug did not arise in practice.
      
      Change-Id: If964251d1807976073ad7f47da0b1f1f77c58413
      Reviewed-on: https://go-review.googlesource.com/38346
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      a68e5d94
    • Josh Bleecher Snyder's avatar
      cmd/compile: canonicalize empty interface types · 62947bed
      Josh Bleecher Snyder authored
      Mapping all empty interfaces onto the same Type
      allows better reuse of the ptrTo and sliceOf
      Type caches for *interface{} and []interface{}.
      
      This has little compiler performance impact now,
      but it will be helpful in the future,
      when we will eagerly populate some of those caches.
      
      Passes toolstash-check.
      
      Change-Id: I17daee599a129b0b2f5f3025c1be43d569d6782c
      Reviewed-on: https://go-review.googlesource.com/38344
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      62947bed
    • Josh Bleecher Snyder's avatar
      cmd/compile: add more types to ssa.Types · 872db799
      Josh Bleecher Snyder authored
      This reduces the number of calls back into the
      gc Type routines, which will help performance
      in a concurrent backend.
      It also reduces the number of callsites
      that must be considered in making the transition.
      
      Passes toolstash-check -all. No compiler performance changes.
      
      Updates #15756
      
      Change-Id: Ic7a8f1daac7e01a21658ae61ac118b2a70804117
      Reviewed-on: https://go-review.googlesource.com/38340
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      872db799
    • Josh Bleecher Snyder's avatar
      cmd/compile: separate ssa.Frontend and ssa.TypeSource · aea3aff6
      Josh Bleecher Snyder authored
      Prior to this CL, the ssa.Frontend field was responsible
      for providing types to the backend during compilation.
      However, the types needed by the backend are few and static.
      It makes more sense to use a struct for them
      and to hang that struct off the ssa.Config,
      which is the correct home for readonly data.
      Now that Types is a struct, we can clean up the names a bit as well.
      
      This has the added benefit of allowing early construction
      of all types needed by the backend.
      This will be useful for concurrent backend compilation.
      
      Passes toolstash-check -all. No compiler performance change.
      
      Updates #15756
      
      Change-Id: I021658c8cf2836d6a22bbc20cc828ac38c7da08a
      Reviewed-on: https://go-review.googlesource.com/38336Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      aea3aff6
  3. 18 Mar, 2017 4 commits
  4. 17 Mar, 2017 22 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile: make stkptrsize local · dc4434a0
      Josh Bleecher Snyder authored
      While we're here, also eliminate a few more Curfn uses.
      
      Passes toolstash -cmp. No compiler performance impact.
      
      Updates #15756
      
      Change-Id: Ib8db9e23467bbaf16cc44bf62d604910f733d6b8
      Reviewed-on: https://go-review.googlesource.com/38331
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      dc4434a0
    • Josh Bleecher Snyder's avatar
      cmd/compile: make Stksize local · 758b5b32
      Josh Bleecher Snyder authored
      Passes toolstash -cmp. No compiler performance impact.
      
      Updates #15756
      
      Change-Id: I85b45244453ae28d4da76be4313badddcbf3f5dc
      Reviewed-on: https://go-review.googlesource.com/38330
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      758b5b32
    • Josh Bleecher Snyder's avatar
      cmd/compile: make Maxarg local · e0a5e69b
      Josh Bleecher Snyder authored
      Passes toolstash -cmp. No compiler performance impact.
      
      Updates #15756
      
      Change-Id: I1294058716d83dd1be495d399ed7ab2277754dc6
      Reviewed-on: https://go-review.googlesource.com/38329
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      e0a5e69b
    • Josh Bleecher Snyder's avatar
      cmd/compile: pass frame size to defframe · 174b858f
      Josh Bleecher Snyder authored
      Preparation for de-globalizing Stksize and MaxArg.
      
      Passes toolstash -cmp. No compiler performance impact.
      
      Updates #15756
      
      Change-Id: I312f0bbd15587a6aebf472cd66c8e62b89e55c8a
      Reviewed-on: https://go-review.googlesource.com/38328
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      174b858f
    • Brad Fitzpatrick's avatar
      Revert "go/types: enforce Check path restrictions via panics" · d83af90a
      Brad Fitzpatrick authored
      This reverts commit b744a11a.
      
      Reason for revert: Broke trybots. (misc-vetall builder is busted)
      
      Change-Id: I651d1c18db2fb3cb6ec12c2ae62024627baf8d77
      Reviewed-on: https://go-review.googlesource.com/38332Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      d83af90a
    • Josh Bleecher Snyder's avatar
      cmd/compile: thread Curfn through SSA · da8e939b
      Josh Bleecher Snyder authored
      This is a first step towards eliminating the
      Curfn global in the backend.
      There's more to do.
      
      Passes toolstash -cmp. No compiler performance impact.
      
      Updates #15756
      
      Change-Id: Ib09f550a001e279a5aeeed0f85698290f890939c
      Reviewed-on: https://go-review.googlesource.com/38232
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      da8e939b
    • Cherry Zhang's avatar
      cmd/compile: using a single Store op for non-pointer non-skip store · ce584e51
      Cherry Zhang authored
      This makes fewer Values around until decomposing, reducing
      allocation in compiler.
      
      name       old alloc/op    new alloc/op    delta
      Template      41.4MB ± 0%     40.8MB ± 0%  -1.29%  (p=0.000 n=10+10)
      Unicode       30.3MB ± 0%     30.2MB ± 0%  -0.24%  (p=0.000 n=10+10)
      GoTypes        118MB ± 0%      115MB ± 0%  -2.23%  (p=0.000 n=10+10)
      Compiler       505MB ± 0%      493MB ± 0%  -2.47%  (p=0.000 n=10+10)
      SSA            881MB ± 0%      872MB ± 0%  -1.03%  (p=0.000 n=10+10)
      
      name       old allocs/op   new allocs/op   delta
      Template        401k ± 1%       400k ± 1%    ~     (p=0.631 n=10+10)
      Unicode         321k ± 0%       321k ± 1%    ~     (p=0.684 n=10+10)
      GoTypes        1.18M ± 0%      1.17M ± 0%  -0.34%  (p=0.000 n=10+10)
      Compiler       4.63M ± 0%      4.61M ± 0%  -0.43%  (p=0.000 n=10+10)
      SSA            7.83M ± 0%      7.82M ± 0%  -0.13%  (p=0.000 n=10+10)
      
      Change-Id: I8f736396294444248a439bd4c90be1357024ce88
      Reviewed-on: https://go-review.googlesource.com/38294
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      ce584e51
    • Josh Bleecher Snyder's avatar
      cmd/compile: move Frontend field from ssa.Config to ssa.Func · 2cdb7f11
      Josh Bleecher Snyder authored
      Suggested by mdempsky in CL 38232.
      This allows us to use the Frontend field
      to associate frontend state and information
      with a function.
      See the following CL in the series for examples.
      
      This is a giant CL, but it is almost entirely routine refactoring.
      
      The ssa test API is starting to feel a bit unwieldy.
      I will clean it up separately, once the dust has settled.
      
      Passes toolstash -cmp.
      
      Updates #15756
      
      Change-Id: I71c573bd96ff7251935fce1391b06b1f133c3caf
      Reviewed-on: https://go-review.googlesource.com/38327
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      2cdb7f11
    • Josh Bleecher Snyder's avatar
      cmd/compile: evaluate config as needed in rewrite rules · 193510f2
      Josh Bleecher Snyder authored
      Prior to this CL, config was an explicit argument
      to the SSA rewrite rules, and rules that needed
      a Frontend got at it via config.
      An upcoming CL moves Frontend from Config to Func,
      so rules can no longer reach Frontend via Config.
      Passing a Frontend as an argument to the rewrite rules
      causes a 2-3% regression in compile times.
      This CL takes a different approach:
      It treats the variable names "config" and "fe"
      as special and calculates them as needed.
      The "as needed part" is also important to performance:
      If they are calculated eagerly, the nilchecks themselves
      cause a regression.
      
      This introduces a little bit of magic into the rewrite
      generator. However, from the perspective of the rules,
      the config variable was already more or less magic.
      And it makes the upcoming changes much clearer.
      
      Passes toolstash -cmp.
      
      Change-Id: I173f2bcc124cba43d53138bfa3775e21316a9107
      Reviewed-on: https://go-review.googlesource.com/38326
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      193510f2
    • Matthew Dempsky's avatar
      cmd/compile/internal/gc: rename Thearch to thearch · 09272ae9
      Matthew Dempsky authored
      Prepared using gorename.
      
      Change-Id: Id55dac9ae5446a8bfeac06e7995b35f4c249eeca
      Reviewed-on: https://go-review.googlesource.com/38302
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      09272ae9
    • Matthew Dempsky's avatar
      cmd/compile: eliminate direct uses of gc.Thearch in backends · 3e2f980e
      Matthew Dempsky authored
      This CL changes the GOARCH.Init functions to take gc.Thearch as a
      parameter, which gc.Main supplies.
      
      Additionally, the x86 backend is refactored to decide within Init
      whether to use the 387 or SSE2 instruction generators, rather than for
      each individual SSA Value/Block.
      
      Passes toolstash-check -all.
      
      Change-Id: Ie6305a6cd6f6ab4e89ecbb3cbbaf5ffd57057a24
      Reviewed-on: https://go-review.googlesource.com/38301
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      3e2f980e
    • Robert Griesemer's avatar
      strconv: replace small int string table with constant string · aea44109
      Robert Griesemer authored
      This reduces memory use yet still provides the significant
      performance gain seen when using a fast path for small integers.
      
      Improvement of this CL comparing to code without fast path:
      
      name              old time/op  new time/op  delta
      FormatIntSmall-8  35.6ns ± 1%   4.5ns ± 1%  -87.30%  (p=0.008 n=5+5)
      AppendIntSmall-8  17.4ns ± 1%   9.4ns ± 3%  -45.70%  (p=0.008 n=5+5)
      
      For comparison, here's the improvement before this CL to code without
      fast path (1% better for FormatIntSmall):
      
      name              old time/op  new time/op  delta
      FormatIntSmall-8  35.6ns ± 1%   4.0ns ± 3%  -88.64%  (p=0.008 n=5+5)
      AppendIntSmall-8  17.4ns ± 1%   8.2ns ± 1%  -52.80%  (p=0.008 n=5+5)
      
      Thus, the code in this CL performs slower for small integers using fast
      path then the prior version, but this is relative to an already very fast
      version:
      
      name              old time/op  new time/op  delta
      FormatIntSmall-8  4.05ns ± 3%  4.52ns ± 1%  +11.81%  (p=0.008 n=5+5)
      AppendIntSmall-8  8.21ns ± 1%  9.45ns ± 3%  +15.05%  (p=0.008 n=5+5)
      
      Measured on 2.3 GHz Intel Core i7 running macOS Sierra 10.12.3.
      
      Overall, it's still ~88% faster than without fast path for small integers,
      so probably worth it as it removes 100 global string slices in favor of
      a single string.
      
      Credits: This is based on the original (but cleaned up) version of the
      code by Aliaksandr Valialkin (https://go-review.googlesource.com/c/37963/).
      
      Change-Id: Icda78679c8c14666d46257894e9fa3d7f35e58b8
      Reviewed-on: https://go-review.googlesource.com/38319Reviewed-by: default avatarMartin Möhrmann <moehrmann@google.com>
      aea44109
    • Daniel Martí's avatar
      go/types: enforce Check path restrictions via panics · b744a11a
      Daniel Martí authored
      Its godoc says that path must not be empty or dot, while the existing
      implementation happily accepts both.
      
      Change-Id: I64766271c35152dc7adb21ff60eb05c52237e6b6
      Reviewed-on: https://go-review.googlesource.com/38262Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      Run-TryBot: Robert Griesemer <gri@golang.org>
      b744a11a
    • Alberto Donizetti's avatar
      encoding/gob: make integers encoding faster · ed00cd94
      Alberto Donizetti authored
      name                old time/op  new time/op  delta
      EncodeInt32Slice-4  14.6µs ± 2%  12.2µs ± 1%  -16.65%  (p=0.000 n=19+18)
      
      Change-Id: I078a171f1633ff81d7e3f981dc9a398309ecb2c0
      Reviewed-on: https://go-review.googlesource.com/38269Reviewed-by: default avatarRob Pike <r@golang.org>
      ed00cd94
    • Keith Randall's avatar
      cmd/compile: intrinsic for math/bits.Reverse on ARM64 · 42e97468
      Keith Randall authored
      I don't know that it exists for any other architectures.
      
      Update #18616
      
      Change-Id: Idfe5dee251764d32787915889ec0be4bebc5be24
      Reviewed-on: https://go-review.googlesource.com/38323
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      42e97468
    • Alexander Menzhinsky's avatar
      cmd/go: fix race libraries rebuilding by `go test -i` · be04da8f
      Alexander Menzhinsky authored
      `go test -i -race` adds the "sync/atomic" package to every package dependency tree
      that makes buildIDs different from packages installed with `go install -race`
      and causes cache rebuilding.
      
      Fixes #19133
      Fixes #19151
      
      Change-Id: I0536c6fa41b0d20fe361b5d35b3c0937b146d07d
      Reviewed-on: https://go-review.googlesource.com/37598Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      be04da8f
    • Alexey Neganov's avatar
      mime: handling invalid mime media parameters · b9f6b22a
      Alexey Neganov authored
      Sometimes it's necessary to deal with emails that do not follow the specification; in particular, it's possible to download such email via gmail.
      When the existing implementation handle invalid mime media parameters, it returns nils and error, although there is a valid media type, which may be returned.
      If this behavior changes, it may not affect any existing programs, but it will help to parse some emails.
      
      Fixes #19498
      
      Change-Id: Ieb2fdbddfd93857faee941d2aa49d59e286d57fd
      Reviewed-on: https://go-review.googlesource.com/38190Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      b9f6b22a
    • Lynn Boger's avatar
      hash/crc32: improve performance for ppc64le · b6cd22c2
      Lynn Boger authored
      This change improves the performance of crc32 for ppc64le by using
      vpmsum and other vector instructions in the algorithm.
      
      The testcase was updated to test more sizes.
      
      Fixes #19570
      
      BenchmarkCRC32/poly=IEEE/size=15/align=0-8             90.5          81.8          -9.61%
      BenchmarkCRC32/poly=IEEE/size=15/align=1-8             89.7          81.7          -8.92%
      BenchmarkCRC32/poly=IEEE/size=40/align=0-8             93.2          61.1          -34.44%
      BenchmarkCRC32/poly=IEEE/size=40/align=1-8             92.8          60.9          -34.38%
      BenchmarkCRC32/poly=IEEE/size=512/align=0-8            501           55.8          -88.86%
      BenchmarkCRC32/poly=IEEE/size=512/align=1-8            502           132           -73.71%
      BenchmarkCRC32/poly=IEEE/size=1kB/align=0-8            947           69.9          -92.62%
      BenchmarkCRC32/poly=IEEE/size=1kB/align=1-8            946           144           -84.78%
      BenchmarkCRC32/poly=IEEE/size=4kB/align=0-8            3602          186           -94.84%
      BenchmarkCRC32/poly=IEEE/size=4kB/align=1-8            3603          263           -92.70%
      BenchmarkCRC32/poly=IEEE/size=32kB/align=0-8           28404         1338          -95.29%
      BenchmarkCRC32/poly=IEEE/size=32kB/align=1-8           28856         1405          -95.13%
      BenchmarkCRC32/poly=Castagnoli/size=15/align=0-8       89.7          81.8          -8.81%
      BenchmarkCRC32/poly=Castagnoli/size=15/align=1-8       89.8          81.9          -8.80%
      BenchmarkCRC32/poly=Castagnoli/size=40/align=0-8       93.8          61.4          -34.54%
      BenchmarkCRC32/poly=Castagnoli/size=40/align=1-8       94.3          61.3          -34.99%
      BenchmarkCRC32/poly=Castagnoli/size=512/align=0-8      503           56.4          -88.79%
      BenchmarkCRC32/poly=Castagnoli/size=512/align=1-8      502           132           -73.71%
      BenchmarkCRC32/poly=Castagnoli/size=1kB/align=0-8      941           70.2          -92.54%
      BenchmarkCRC32/poly=Castagnoli/size=1kB/align=1-8      943           145           -84.62%
      BenchmarkCRC32/poly=Castagnoli/size=4kB/align=0-8      3588          186           -94.82%
      BenchmarkCRC32/poly=Castagnoli/size=4kB/align=1-8      3595          264           -92.66%
      BenchmarkCRC32/poly=Castagnoli/size=32kB/align=0-8     28266         1323          -95.32%
      BenchmarkCRC32/poly=Castagnoli/size=32kB/align=1-8     28344         1404          -95.05%
      
      Change-Id: Ic4d8274c66e0e87bfba5f609f508a3877aee6bb5
      Reviewed-on: https://go-review.googlesource.com/38184Reviewed-by: default avatarDavid Chase <drchase@google.com>
      b6cd22c2
    • Nigel Tao's avatar
      image/png: decode Gray8 transparent images. · 16663a85
      Nigel Tao authored
      Fixes #19553.
      
      Change-Id: I414cb3b1c2dab20f41a7f4e7aba49c534ff19942
      Reviewed-on: https://go-review.googlesource.com/38271Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      16663a85
    • Josh Bleecher Snyder's avatar
      cmd/compile: relocate code from config.go to func.go · 88e47187
      Josh Bleecher Snyder authored
      This is a follow-up to CL 38167.
      Pure code movement.
      
      Change-Id: I13e58f7eac6718c77076d89e13fc721a5205ec57
      Reviewed-on: https://go-review.googlesource.com/38322
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      88e47187
    • Josh Bleecher Snyder's avatar
      cmd/compile: rearrange fields between ssa.Func, ssa.Cache, and ssa.Config · a5e3cac8
      Josh Bleecher Snyder authored
      This makes ssa.Func, ssa.Cache, and ssa.Config fulfill
      the roles laid out for them in CL 38160.
      
      The only non-trivial change in this CL is how cached
      values and blocks get IDs. Prior to this CL, their IDs were
      assigned as part of resetting the cache, and only modified
      IDs were reset. This required knowing how many values and
      blocks were modified, which required a tight coupling between
      ssa.Func and ssa.Config. To eliminate that coupling,
      we now zero values and blocks during reset,
      and assign their IDs when they are used.
      Since unused values and blocks have ID == 0,
      we can efficiently find the last used value/block,
      to avoid zeroing everything.
      Bulk zeroing is efficient, but not efficient enough
      to obviate the need to avoid zeroing everything every time.
      As a happy side-effect, ssa.Func.Free is no longer necessary.
      
      DebugHashMatch and friends now belong in func.go.
      They have been left in place for clarity and review.
      I will move them in a subsequent CL.
      
      Passes toolstash -cmp. No compiler performance impact.
      No change in 'go test cmd/compile/internal/ssa' execution time.
      
      Change-Id: I2eb7af58da067ef6a36e815a6f386cfe8634d098
      Reviewed-on: https://go-review.googlesource.com/38167
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      a5e3cac8
    • Josh Bleecher Snyder's avatar
      cmd/compile: avoid calling unnecessary Sym format routine · ccaa8e3c
      Josh Bleecher Snyder authored
      Minor cleanup only.
      
      No reason to go through String() when it is
      just as easy to do a direct string comparison.
      
      Eliminates a surprising number of allocations.
      
      name       old alloc/op    new alloc/op    delta
      Template      40.9MB ± 0%     40.9MB ± 0%    ~     (p=0.190 n=10+10)
      Unicode       30.3MB ± 0%     30.3MB ± 0%    ~     (p=0.218 n=10+10)
      GoTypes        116MB ± 0%      116MB ± 0%  -0.09%  (p=0.000 n=10+10)
      SSA            871MB ± 0%      869MB ± 0%  -0.14%  (p=0.000 n=10+9)
      Flate         26.2MB ± 0%     26.2MB ± 0%  -0.15%  (p=0.002 n=10+10)
      GoParser      32.5MB ± 0%     32.5MB ± 0%    ~     (p=0.165 n=10+10)
      Reflect       80.5MB ± 0%     80.4MB ± 0%  -0.12%  (p=0.003 n=9+10)
      Tar           27.3MB ± 0%     27.3MB ± 0%  -0.13%  (p=0.008 n=10+9)
      XML           43.1MB ± 0%     43.1MB ± 0%    ~     (p=0.218 n=10+10)
      
      name       old allocs/op   new allocs/op   delta
      Template        402k ± 1%       400k ± 1%  -0.64%  (p=0.002 n=10+10)
      Unicode         322k ± 1%       321k ± 1%    ~     (p=0.075 n=10+10)
      GoTypes        1.19M ± 0%      1.18M ± 0%  -0.90%  (p=0.000 n=10+10)
      SSA            7.94M ± 0%      7.81M ± 0%  -1.66%  (p=0.000 n=10+9)
      Flate           246k ± 0%       242k ± 1%  -1.42%  (p=0.000 n=10+10)
      GoParser        325k ± 1%       323k ± 1%  -0.84%  (p=0.000 n=10+10)
      Reflect        1.02M ± 0%      1.01M ± 0%  -0.99%  (p=0.000 n=10+10)
      Tar             259k ± 0%       257k ± 1%  -0.72%  (p=0.009 n=10+10)
      XML             406k ± 1%       403k ± 1%  -0.69%  (p=0.001 n=10+10)
      
      Change-Id: Ia129a4cd272027d627e1f3b27e9f07f93e3aa27e
      Reviewed-on: https://go-review.googlesource.com/38230Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      ccaa8e3c