1. 19 Mar, 2017 8 commits
    • 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
  2. 18 Mar, 2017 4 commits
  3. 17 Mar, 2017 26 commits
  4. 16 Mar, 2017 2 commits
    • Jeremy Jackins's avatar
      cmd/compile: further clarify assignment count mismatch error message · 73a44f04
      Jeremy Jackins authored
      This is an evolution of https://go-review.googlesource.com/33616, as discussed
      via email with Robert (gri):
      
      $ cat foobar.go
      package main
      
      func main() {
              a := "foo", "bar"
      }
      
      before:
      ./foobar.go:4:4: assignment count mismatch: want 1 values, got 2
      
      after:
      ./foobar.go:4:4: assignment count mismatch: cannot assign 2 values to 1 variables
      
      We could likely also eliminate the "assignment count mismatch" prefix now
      without losing any information, but that string is matched by a number of
      tests.
      
      Change-Id: Ie6fc8a7bbd0ebe841d53e66e5c2f49868decf761
      Reviewed-on: https://go-review.googlesource.com/38313Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      73a44f04
    • Keith Randall's avatar
      cmd/compile: intrinsics for math/bits.{Len,LeadingZeros} · 495b1679
      Keith Randall authored
      name              old time/op  new time/op  delta
      LeadingZeros-4    2.00ns ± 0%  1.34ns ± 1%  -33.02%  (p=0.000 n=8+10)
      LeadingZeros16-4  1.62ns ± 0%  1.57ns ± 0%   -3.09%  (p=0.001 n=8+9)
      LeadingZeros32-4  2.14ns ± 0%  1.48ns ± 0%  -30.84%  (p=0.002 n=8+10)
      LeadingZeros64-4  2.06ns ± 1%  1.33ns ± 0%  -35.08%  (p=0.000 n=8+8)
      
      8-bit args is a special case - the Go code is really fast because
      it is just a single table lookup.  So I've disabled that for now.
      Intrinsics were actually slower:
      LeadingZeros8-4   1.22ns ± 3%  1.58ns ± 1%  +29.56%  (p=0.000 n=10+10)
      
      Update #18616
      
      Change-Id: Ia9c289b9ba59c583ea64060470315fd637e814cf
      Reviewed-on: https://go-review.googlesource.com/38311
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      495b1679