1. 28 Oct, 2016 33 commits
  2. 27 Oct, 2016 7 commits
    • Matthew Dempsky's avatar
      cmd/compile: stop adding implicit OKEY nodes · bba1ac4f
      Matthew Dempsky authored
      Keys are uncommon in array and slice literals, and normalizing
      OARRAYLIT and OSLICELIT nodes to always use OKEY ends up not reducing
      complexity much. Instead, only create OKEY nodes to represent explicit
      keys, and recalculate implicit keys when/where necessary.
      
      Fixes #15350.
      
      name       old time/op     new time/op     delta
      Template       299ms ± 9%      299ms ±12%    ~           (p=0.694 n=28+30)
      Unicode        165ms ± 7%      162ms ± 9%    ~           (p=0.084 n=27+27)
      GoTypes        950ms ± 9%      963ms ± 5%    ~           (p=0.301 n=30+29)
      Compiler       4.23s ± 7%      4.17s ± 7%    ~           (p=0.057 n=29+27)
      
      name       old user-ns/op  new user-ns/op  delta
      Template        389M ±15%       400M ±12%    ~           (p=0.202 n=30+29)
      Unicode         246M ±21%       232M ±22%  -5.76%        (p=0.006 n=28+29)
      GoTypes        1.34G ± 8%      1.34G ± 7%    ~           (p=0.775 n=28+30)
      Compiler       5.91G ± 6%      5.87G ± 7%    ~           (p=0.298 n=28+29)
      
      name       old alloc/op    new alloc/op    delta
      Template      41.2MB ± 0%     41.2MB ± 0%    ~           (p=0.085 n=30+30)
      Unicode       34.0MB ± 0%     31.5MB ± 0%  -7.28%        (p=0.000 n=30+29)
      GoTypes        121MB ± 0%      121MB ± 0%    ~           (p=0.657 n=30+30)
      Compiler       511MB ± 0%      511MB ± 0%  -0.01%        (p=0.001 n=29+29)
      
      name       old allocs/op   new allocs/op   delta
      Template        390k ± 0%       390k ± 0%    ~           (p=0.225 n=30+29)
      Unicode         318k ± 0%       293k ± 0%  -8.03%        (p=0.000 n=30+29)
      GoTypes        1.16M ± 0%      1.16M ± 0%    ~           (p=0.745 n=30+30)
      Compiler       4.35M ± 0%      4.35M ± 0%    ~           (p=0.105 n=30+30)
      
      Change-Id: I6310739a0bfdb54f1ab8a460b2c03615ad1ff5bc
      Reviewed-on: https://go-review.googlesource.com/32221
      
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      bba1ac4f
    • Nigel Tao's avatar
      image/png: implement truecolor transparency. · 4951c793
      Nigel Tao authored
      Change-Id: I99b9a51db29d514ebaa9c1cfde65c0b5184c0f42
      Reviewed-on: https://go-review.googlesource.com/32140
      
      Reviewed-by: default avatarRob Pike <r@golang.org>
      4951c793
    • Cherry Zhang's avatar
      math/big: flip long/short flag on TestFloat32Distribution · 0dabbcdc
      Cherry Zhang authored
      It looks like a typo in CL 30707.
      
      Change-Id: Ia2d013567dbd1a49901d9be0cd2d5a103e6e38cf
      Reviewed-on: https://go-review.googlesource.com/32187
      
      
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      0dabbcdc
    • Keith Randall's avatar
      cmd/compile: combine some extensions with loads · f357091a
      Keith Randall authored
      For cases where we already have the ops, combine
      sign or zero extension with the previous load
      (even if the load is larger width).
      
      Update #15105
      
      Change-Id: I76c5ddd69e1f900d2a17d35503083bd3b4978e48
      Reviewed-on: https://go-review.googlesource.com/28190
      
      
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      f357091a
    • Josh Bleecher Snyder's avatar
      cmd/compile: eliminate Name.Inlvar · dc5f9311
      Josh Bleecher Snyder authored
      Use a local map during inlining instead.
      
      Change-Id: I10cd19885e7124f812bb04a79dbda52bfebfe1a1
      Reviewed-on: https://go-review.googlesource.com/32225
      
      
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      dc5f9311
    • Keith Randall's avatar
      cmd/compile: remove redundant extension after shift · ac74225d
      Keith Randall authored
      var x uint64
      uint8(x >> 56)
      
      We don't need to generate any code for the uint8().
      
      Update #15090
      
      Change-Id: Ie1ca4e32022dccf7f7bc42d531a285521fb67872
      Reviewed-on: https://go-review.googlesource.com/28191
      
      
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      ac74225d
    • Keith Randall's avatar
      cmd/compile: use masks instead of branches for slicing · deb4177c
      Keith Randall authored
      When we do
      
        var x []byte = ...
        y := x[i:]
      
      We can't just use y.ptr = x.ptr + i, as the new pointer may point to the
      next object in memory after the backing array.
      We used to fix this by doing:
      
        y.cap = x.cap - i
        delta := i
        if y.cap == 0 {
          delta = 0
        }
        y.ptr = x.ptr + delta
      
      That generates a branch in what is otherwise straight-line code.
      
      Better to do:
      
        y.cap = x.cap - i
        mask := (y.cap - 1) >> 63 // -1 if y.cap==0, 0 otherwise
        y.ptr = x.ptr + i &^ mask
      
      It's about the same number of instructions (~4, depending on what
      parts are constant, and the target architecture), but it is all
      inline. It plays nicely with CSE, and the mask can be computed
      in parallel with the index (in cases where a multiply is required).
      
      It is a minor win in both speed and space.
      
      Change-Id: Ied60465a0b8abb683c02208402e5bb7ac0e8370f
      Reviewed-on: https://go-review.googlesource.com/32022
      
      
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      deb4177c