1. 23 Apr, 2018 10 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile: rewrite 2*x+c into LEAx1 on amd64 · d292f77e
      Josh Bleecher Snyder authored
      Rewrite x<<1+c into x+x+c, which can be expressed as a single LEAQ/LEAL.
      
      Bit of a special case, but the single-instruction
      LEA is both shorter and faster than SHL then ADD.
      
      Triggers 293 times during make.bash.
      
      Change-Id: I3f09c8e9a8f3859d1eeed336f095fc3ada79c2c1
      Reviewed-on: https://go-review.googlesource.com/108938
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      d292f77e
    • Rodolfo Carvalho's avatar
      doc: correct statement in go1.10 release notes · c0769741
      Rodolfo Carvalho authored
      The language spec requires the RHS operand of shift expressions to be unsigned integers.
      
      The changes in CL 60230 and the related CL 81277 refer to a variable s of type uint.
      The "untyped constant" here refers to 1.0, not s.
      
      Change-Id: Id2b884816af7f79f453afcb8c34ade2d34e18bc2
      GitHub-Last-Rev: b26c853cae2adea7235a51ad726308e337494385
      GitHub-Pull-Request: golang/go#24989
      Reviewed-on: https://go-review.googlesource.com/108676Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      c0769741
    • Josh Bleecher Snyder's avatar
      cmd/compile: add amd64 LEAL{1,2,4,8} ops · 22115859
      Josh Bleecher Snyder authored
      For future use in rewrite rules.
      
      Change-Id: Ic9875beb0dea6e0bbcbd4b75d99a53f4a9a7c3fd
      Reviewed-on: https://go-review.googlesource.com/101275
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      22115859
    • isharipo's avatar
      cmd/internal/obj/x86: faster Assemble for non-NaCl hosts · 8e3dd8ab
      isharipo authored
      Make span6 function (used as LinkArch.Assemble) faster
      by avoiding redundant re-assemble rounds on hosts
      that are not NaCl.
      
      NaCl is excluded because it needs Prog.Isize to fix alignment.
      
      For make.bash, there are around 50% of functions that can
      be encoded in a single trip. With this change, those function
      will be assembled with 1 round instead of 2.
      
      compilebench results:
      
          name        old time/op       new time/op       delta
          Template          305ms ± 2%        299ms ± 2%  -1.99%  (p=0.001 n=10+10)
          Unicode           139ms ± 3%        138ms ± 4%    ~     (p=0.222 n=9+9)
          GoTypes           1.05s ± 1%        1.04s ± 1%  -1.34%  (p=0.000 n=10+9)
          Compiler          4.78s ± 1%        4.71s ± 1%  -1.45%  (p=0.000 n=9+9)
          SSA               12.2s ± 1%        12.0s ± 1%  -1.90%  (p=0.000 n=9+10)
          Flate             204ms ± 3%        202ms ± 3%    ~     (p=0.052 n=10+10)
          GoParser          248ms ± 1%        244ms ± 2%  -1.79%  (p=0.000 n=10+9)
          Reflect           671ms ± 1%        664ms ± 1%  -0.96%  (p=0.001 n=9+9)
          Tar               287ms ± 2%        285ms ± 3%    ~     (p=0.393 n=10+10)
          XML               362ms ± 1%        353ms ± 2%  -2.60%  (p=0.000 n=10+9)
          StdCmd            29.2s ± 1%        29.0s ± 1%  -0.63%  (p=0.021 n=10+8)
          [Geo mean]        888ms             875ms       -1.40%
      
          name        old user-time/op  new user-time/op  delta
          Template          393ms ± 5%        373ms ± 8%  -5.12%  (p=0.013 n=9+10)
          Unicode           185ms ± 6%        184ms ± 5%    ~     (p=0.825 n=10+10)
          GoTypes           1.33s ± 1%        1.31s ± 3%  -1.60%  (p=0.004 n=10+10)
          Compiler          5.98s ± 3%        5.92s ± 1%    ~     (p=0.050 n=10+10)
          SSA               15.5s ± 2%        15.3s ± 0%    ~     (p=0.156 n=10+9)
          Flate             255ms ± 5%        252ms ± 5%    ~     (p=0.362 n=10+10)
          GoParser          309ms ± 1%        304ms ± 3%  -1.79%  (p=0.021 n=7+10)
          Reflect           839ms ± 2%        833ms ± 1%    ~     (p=0.160 n=10+9)
          Tar               363ms ± 3%        358ms ± 4%    ~     (p=0.194 n=8+10)
          XML               446ms ± 3%        442ms ± 3%    ~     (p=0.503 n=10+10)
          [Geo mean]        791ms             779ms       -1.55%
      
      Passes toolstash-check.
      
      Change-Id: Ibcdb09f2c28907932581b7566f46d34be292594b
      Reviewed-on: https://go-review.googlesource.com/108895
      Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      8e3dd8ab
    • ludweeg's avatar
      crypto: make receiver name consistent · 0cd0dc96
      ludweeg authored
      Fixes go lint warning.
      
      Change-Id: I63950e7c70bf431e88a04f32befd50be9beacadf
      Reviewed-on: https://go-review.googlesource.com/108815Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      0cd0dc96
    • Matthew Dempsky's avatar
      cmd/compile: remove toolstash workaround in bexport.go · 545ef110
      Matthew Dempsky authored
      Change-Id: Ie4facdcab4b35cf7d350c4b8fa06a3c5a0c6caeb
      Reviewed-on: https://go-review.googlesource.com/108875
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      545ef110
    • Matthew Dempsky's avatar
      cmd/compile: replace Field.Nname.Pos with Field.Pos · 7759b32a
      Matthew Dempsky authored
      For struct fields and methods, Field.Nname was only used to store
      position information, which means we're allocating an entire ONAME
      Node+Name+Param structure just for one field. We can optimize away
      these ONAME allocations by instead adding a Field.Pos field.
      
      Unfortunately, we can't get rid of Field.Nname, because it's needed
      for function parameters, so Field grows a little bit and now has more
      redundant information in those cases. However, that was already the
      case (e.g., Field.Sym and Field.Nname.Sym), and it's still a net win
      for allocations as demonstrated by the benchmarks below.
      
      Additionally, by moving the ONAME allocation for function parameters
      to funcargs, we can avoid allocating them for function parameters that
      aren't used in corresponding function bodies (e.g., interface methods,
      function-typed variables, and imported functions/methods without
      inline bodies).
      
      name       old time/op       new time/op       delta
      Template         254ms ± 6%        251ms ± 6%  -1.04%  (p=0.000 n=487+488)
      Unicode          128ms ± 7%        128ms ± 7%    ~     (p=0.294 n=482+467)
      GoTypes          862ms ± 5%        860ms ± 4%    ~     (p=0.075 n=488+471)
      Compiler         3.91s ± 4%        3.90s ± 4%  -0.39%  (p=0.000 n=468+473)
      
      name       old user-time/op  new user-time/op  delta
      Template         339ms ±14%        336ms ±14%  -1.02%  (p=0.001 n=498+494)
      Unicode          176ms ±18%        176ms ±25%    ~     (p=0.940 n=491+499)
      GoTypes          1.13s ± 8%        1.13s ± 9%    ~     (p=0.157 n=496+493)
      Compiler         5.24s ± 6%        5.21s ± 6%  -0.57%  (p=0.000 n=485+489)
      
      name       old alloc/op      new alloc/op      delta
      Template        38.3MB ± 0%       37.3MB ± 0%  -2.58%  (p=0.000 n=499+497)
      Unicode         29.1MB ± 0%       29.1MB ± 0%  -0.03%  (p=0.000 n=500+493)
      GoTypes          116MB ± 0%        115MB ± 0%  -0.65%  (p=0.000 n=498+499)
      Compiler         492MB ± 0%        487MB ± 0%  -1.00%  (p=0.000 n=497+498)
      
      name       old allocs/op     new allocs/op     delta
      Template          364k ± 0%         360k ± 0%  -1.15%  (p=0.000 n=499+499)
      Unicode           336k ± 0%         336k ± 0%  -0.01%  (p=0.000 n=500+493)
      GoTypes          1.16M ± 0%        1.16M ± 0%  -0.30%  (p=0.000 n=499+499)
      Compiler         4.54M ± 0%        4.51M ± 0%  -0.58%  (p=0.000 n=494+495)
      
      Passes toolstash-check -gcflags=-dwarf=false. Changes DWARF output
      because position information is now tracked more precisely for
      function parameters.
      
      Change-Id: Ib8077d70d564cc448c5e4290baceab3a4396d712
      Reviewed-on: https://go-review.googlesource.com/108217
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      7759b32a
    • Austin Clements's avatar
      cmd/compile: don't compact liveness maps in place · bdb65da0
      Austin Clements authored
      Currently Liveness.compact rewrites the Liveness.livevars slice in
      place. However, we're about to add register maps, which we'll want to
      track in livevars, but compact independently from the stack maps.
      Hence, this CL modifies Liveness.compact to consume Liveness.livevars
      and produce a new slice of deduplicated stack maps. This is somewhat
      clearer anyway because it avoids potential confusion over how
      Liveness.livevars is indexed.
      
      Passes toolstash -cmp.
      
      For #24543.
      
      Change-Id: I7093fbc71143f8a29e677aa30c96e501f953ca2b
      Reviewed-on: https://go-review.googlesource.com/108498
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      bdb65da0
    • Elias Naur's avatar
      cmd/link: remove R_ADDR relocation workaround for macho arm64 · 3363e983
      Elias Naur authored
      The workarounds doesn't seem necessary anymore, and blocks DWARF
      on darwin/arm64.
      
      Updates #24883.
      
      Change-Id: Ic917c767d3b4f6c51be25566956296f5dd4ead10
      Reviewed-on: https://go-review.googlesource.com/108655
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      3363e983
    • ludweeg's avatar
      crypto/md5: make receiver name consistent · 1f718926
      ludweeg authored
      Fixes go lint warning.
      
      Change-Id: I2d73208c6841f35d7a21a1fb4cfafbbd4250228f
      Reviewed-on: https://go-review.googlesource.com/108659Reviewed-by: default avatarIskander Sharipov <iskander.sharipov@intel.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      1f718926
  2. 22 Apr, 2018 2 commits
  3. 21 Apr, 2018 6 commits
  4. 20 Apr, 2018 18 commits
  5. 19 Apr, 2018 4 commits