1. 05 Sep, 2018 2 commits
    • Michael Munday's avatar
      cmd/compile: make math/bits.RotateLeft{32,64} intrinsics on s390x · f94de9c9
      Michael Munday authored
      Extends CL 132435 to s390x. s390x has 32- and 64-bit variable
      rotate left instructions.
      
      Change-Id: Ic4f1ebb0e0543207ed2fc8c119e0163b428138a5
      Reviewed-on: https://go-review.googlesource.com/133035
      Run-TryBot: Michael Munday <mike.munday@ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      f94de9c9
    • Ben Shi's avatar
      cmd/compile: optimize arm64's comparison · 0e9f1de0
      Ben Shi authored
      Add more optimization with TST/CMN.
      
      1. A tiny benchmark shows more than 12% improvement.
      TSTCMN-4                    378µs ± 0%     332µs ± 0%  -12.15%  (p=0.000 n=30+27)
      (https://github.com/benshi001/ugo1/blob/master/tstcmn_test.go)
      
      2. There is little regression in the go1 benchmark, excluding noise.
      
      name                     old time/op    new time/op    delta
      BinaryTree17-4              19.1s ± 0%     19.1s ± 0%    ~     (p=0.994 n=28+29)
      Fannkuch11-4                10.0s ± 0%     10.0s ± 0%    ~     (p=0.198 n=30+25)
      FmtFprintfEmpty-4           233ns ± 0%     233ns ± 0%  +0.14%  (p=0.002 n=24+30)
      FmtFprintfString-4          428ns ± 0%     428ns ± 0%    ~     (all equal)
      FmtFprintfInt-4             472ns ± 0%     472ns ± 0%    ~     (all equal)
      FmtFprintfIntInt-4          725ns ± 0%     725ns ± 0%    ~     (all equal)
      FmtFprintfPrefixedInt-4     889ns ± 0%     888ns ± 0%    ~     (p=0.632 n=28+30)
      FmtFprintfFloat-4          1.20µs ± 0%    1.20µs ± 0%  +0.05%  (p=0.001 n=18+30)
      FmtManyArgs-4              3.00µs ± 0%    2.99µs ± 0%  -0.07%  (p=0.001 n=27+30)
      GobDecode-4                42.1ms ± 0%    42.2ms ± 0%  +0.29%  (p=0.000 n=28+28)
      GobEncode-4                38.6ms ± 9%    38.8ms ± 9%    ~     (p=0.912 n=30+30)
      Gzip-4                      2.07s ± 1%     2.05s ± 1%  -0.64%  (p=0.000 n=29+30)
      Gunzip-4                    175ms ± 0%     175ms ± 0%  -0.15%  (p=0.001 n=30+30)
      HTTPClientServer-4          872µs ± 5%     880µs ± 6%    ~     (p=0.196 n=30+29)
      JSONEncode-4               88.5ms ± 1%    89.8ms ± 1%  +1.49%  (p=0.000 n=23+24)
      JSONDecode-4                393ms ± 1%     390ms ± 1%  -0.89%  (p=0.000 n=28+30)
      Mandelbrot200-4            19.5ms ± 0%    19.5ms ± 0%    ~     (p=0.405 n=29+28)
      GoParse-4                  19.9ms ± 0%    20.0ms ± 0%  +0.27%  (p=0.000 n=30+30)
      RegexpMatchEasy0_32-4       431ns ± 0%     431ns ± 0%    ~     (p=1.000 n=30+30)
      RegexpMatchEasy0_1K-4      1.61µs ± 0%    1.61µs ± 0%    ~     (p=0.527 n=26+26)
      RegexpMatchEasy1_32-4       443ns ± 0%     443ns ± 0%    ~     (all equal)
      RegexpMatchEasy1_1K-4      2.58µs ± 1%    2.58µs ± 1%    ~     (p=0.578 n=27+25)
      RegexpMatchMedium_32-4      740ns ± 0%     740ns ± 0%    ~     (p=0.357 n=30+30)
      RegexpMatchMedium_1K-4      223µs ± 0%     223µs ± 0%  +0.16%  (p=0.000 n=30+29)
      RegexpMatchHard_32-4       12.3µs ± 0%    12.3µs ± 0%    ~     (p=0.236 n=27+27)
      RegexpMatchHard_1K-4        371µs ± 0%     371µs ± 0%  +0.09%  (p=0.000 n=30+27)
      Revcomp-4                   2.85s ± 0%     2.85s ± 0%    ~     (p=0.057 n=28+25)
      Template-4                  408ms ± 1%     409ms ± 1%    ~     (p=0.117 n=29+29)
      TimeParse-4                1.93µs ± 0%    1.93µs ± 0%    ~     (p=0.535 n=29+28)
      TimeFormat-4               1.99µs ± 0%    1.99µs ± 0%    ~     (p=0.168 n=29+28)
      [Geo mean]                  306µs          307µs       +0.07%
      
      name                     old speed      new speed      delta
      GobDecode-4              18.3MB/s ± 0%  18.2MB/s ± 0%  -0.31%  (p=0.000 n=28+29)
      GobEncode-4              19.9MB/s ± 8%  19.8MB/s ± 9%    ~     (p=0.923 n=30+30)
      Gzip-4                   9.39MB/s ± 1%  9.45MB/s ± 1%  +0.65%  (p=0.000 n=29+30)
      Gunzip-4                  111MB/s ± 0%   111MB/s ± 0%  +0.15%  (p=0.001 n=30+30)
      JSONEncode-4             21.9MB/s ± 1%  21.6MB/s ± 1%  -1.45%  (p=0.000 n=23+23)
      JSONDecode-4             4.94MB/s ± 1%  4.98MB/s ± 1%  +0.84%  (p=0.000 n=27+30)
      GoParse-4                2.91MB/s ± 0%  2.90MB/s ± 0%  -0.34%  (p=0.000 n=21+22)
      RegexpMatchEasy0_32-4    74.1MB/s ± 0%  74.1MB/s ± 0%    ~     (p=0.469 n=29+28)
      RegexpMatchEasy0_1K-4     634MB/s ± 0%   634MB/s ± 0%    ~     (p=0.978 n=24+28)
      RegexpMatchEasy1_32-4    72.2MB/s ± 0%  72.2MB/s ± 0%    ~     (p=0.064 n=27+29)
      RegexpMatchEasy1_1K-4     396MB/s ± 1%   396MB/s ± 1%    ~     (p=0.583 n=27+25)
      RegexpMatchMedium_32-4   1.35MB/s ± 0%  1.35MB/s ± 0%    ~     (all equal)
      RegexpMatchMedium_1K-4   4.60MB/s ± 0%  4.59MB/s ± 0%  -0.14%  (p=0.000 n=30+26)
      RegexpMatchHard_32-4     2.61MB/s ± 0%  2.61MB/s ± 0%    ~     (all equal)
      RegexpMatchHard_1K-4     2.76MB/s ± 0%  2.76MB/s ± 0%    ~     (all equal)
      Revcomp-4                89.1MB/s ± 0%  89.1MB/s ± 0%    ~     (p=0.059 n=28+25)
      Template-4               4.75MB/s ± 1%  4.75MB/s ± 1%    ~     (p=0.106 n=29+29)
      [Geo mean]               18.3MB/s       18.3MB/s       -0.07%
      
      Change-Id: I3cd76ce63e84b0c3cebabf9fa3573b76a7343899
      Reviewed-on: https://go-review.googlesource.com/124935
      Run-TryBot: Ben Shi <powerman1st@163.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      0e9f1de0
  2. 04 Sep, 2018 10 commits
    • Ben Shi's avatar
      cmd/compile: optimize ARM64's code with MADD/MSUB · b4442151
      Ben Shi authored
      MADD does MUL-ADD in a single instruction, and MSUB does the
      similiar simplification for MUL-SUB.
      
      The CL implements the optimization with MADD/MSUB.
      
      1. The total size of pkg/android_arm64/ decreases about 20KB,
      excluding cmd/compile/.
      
      2. The go1 benchmark shows a little improvement for RegexpMatchHard_32-4
      and Template-4, excluding noise.
      
      name                     old time/op    new time/op    delta
      BinaryTree17-4              16.3s ± 1%     16.5s ± 1%  +1.41%  (p=0.000 n=26+28)
      Fannkuch11-4                8.79s ± 1%     8.76s ± 0%  -0.36%  (p=0.000 n=26+28)
      FmtFprintfEmpty-4           172ns ± 0%     172ns ± 0%    ~     (all equal)
      FmtFprintfString-4          362ns ± 1%     364ns ± 0%  +0.55%  (p=0.000 n=30+30)
      FmtFprintfInt-4             416ns ± 0%     416ns ± 0%    ~     (p=0.099 n=22+30)
      FmtFprintfIntInt-4          655ns ± 1%     660ns ± 1%  +0.76%  (p=0.000 n=30+30)
      FmtFprintfPrefixedInt-4     810ns ± 0%     809ns ± 0%  -0.08%  (p=0.009 n=29+29)
      FmtFprintfFloat-4          1.08µs ± 0%    1.09µs ± 0%  +0.61%  (p=0.000 n=30+29)
      FmtManyArgs-4              2.70µs ± 0%    2.69µs ± 0%  -0.23%  (p=0.000 n=29+28)
      GobDecode-4                32.2ms ± 1%    32.1ms ± 1%  -0.39%  (p=0.000 n=27+26)
      GobEncode-4                27.4ms ± 2%    27.4ms ± 1%    ~     (p=0.864 n=28+28)
      Gzip-4                      1.53s ± 1%     1.52s ± 1%  -0.30%  (p=0.031 n=29+29)
      Gunzip-4                    146ms ± 0%     146ms ± 0%  -0.14%  (p=0.001 n=25+30)
      HTTPClientServer-4         1.00ms ± 4%    0.98ms ± 6%  -1.65%  (p=0.001 n=29+30)
      JSONEncode-4               67.3ms ± 1%    67.2ms ± 1%    ~     (p=0.520 n=28+28)
      JSONDecode-4                329ms ± 5%     330ms ± 4%    ~     (p=0.142 n=30+30)
      Mandelbrot200-4            17.3ms ± 0%    17.3ms ± 0%    ~     (p=0.055 n=26+29)
      GoParse-4                  16.9ms ± 1%    17.0ms ± 1%  +0.82%  (p=0.000 n=30+30)
      RegexpMatchEasy0_32-4       382ns ± 0%     382ns ± 0%    ~     (all equal)
      RegexpMatchEasy0_1K-4      1.33µs ± 0%    1.33µs ± 0%  -0.25%  (p=0.000 n=30+27)
      RegexpMatchEasy1_32-4       361ns ± 0%     361ns ± 0%  -0.08%  (p=0.002 n=30+28)
      RegexpMatchEasy1_1K-4      2.11µs ± 0%    2.09µs ± 0%  -0.54%  (p=0.000 n=30+29)
      RegexpMatchMedium_32-4      594ns ± 0%     592ns ± 0%  -0.32%  (p=0.000 n=30+30)
      RegexpMatchMedium_1K-4      173µs ± 0%     172µs ± 0%  -0.77%  (p=0.000 n=29+27)
      RegexpMatchHard_32-4       10.4µs ± 0%    10.1µs ± 0%  -3.63%  (p=0.000 n=28+27)
      RegexpMatchHard_1K-4        306µs ± 0%     301µs ± 0%  -1.64%  (p=0.000 n=29+30)
      Revcomp-4                   2.51s ± 1%     2.52s ± 0%  +0.18%  (p=0.017 n=26+27)
      Template-4                  394ms ± 3%     382ms ± 3%  -3.22%  (p=0.000 n=28+28)
      TimeParse-4                1.67µs ± 0%    1.67µs ± 0%  +0.05%  (p=0.030 n=27+30)
      TimeFormat-4               1.72µs ± 0%    1.70µs ± 0%  -0.79%  (p=0.000 n=28+26)
      [Geo mean]                  259µs          259µs       -0.33%
      
      name                     old speed      new speed      delta
      GobDecode-4              23.8MB/s ± 1%  23.9MB/s ± 1%  +0.40%  (p=0.001 n=27+26)
      GobEncode-4              28.0MB/s ± 2%  28.0MB/s ± 1%    ~     (p=0.863 n=28+28)
      Gzip-4                   12.7MB/s ± 1%  12.7MB/s ± 1%  +0.32%  (p=0.026 n=29+29)
      Gunzip-4                  133MB/s ± 0%   133MB/s ± 0%  +0.15%  (p=0.001 n=24+30)
      JSONEncode-4             28.8MB/s ± 1%  28.9MB/s ± 1%    ~     (p=0.475 n=28+28)
      JSONDecode-4             5.89MB/s ± 4%  5.87MB/s ± 5%    ~     (p=0.174 n=29+30)
      GoParse-4                3.43MB/s ± 0%  3.40MB/s ± 1%  -0.83%  (p=0.000 n=28+30)
      RegexpMatchEasy0_32-4    83.6MB/s ± 0%  83.6MB/s ± 0%    ~     (p=0.848 n=28+29)
      RegexpMatchEasy0_1K-4     768MB/s ± 0%   770MB/s ± 0%  +0.25%  (p=0.000 n=30+27)
      RegexpMatchEasy1_32-4    88.5MB/s ± 0%  88.5MB/s ± 0%    ~     (p=0.086 n=29+29)
      RegexpMatchEasy1_1K-4     486MB/s ± 0%   489MB/s ± 0%  +0.54%  (p=0.000 n=30+29)
      RegexpMatchMedium_32-4   1.68MB/s ± 0%  1.69MB/s ± 0%  +0.60%  (p=0.000 n=30+23)
      RegexpMatchMedium_1K-4   5.90MB/s ± 0%  5.95MB/s ± 0%  +0.85%  (p=0.000 n=18+20)
      RegexpMatchHard_32-4     3.07MB/s ± 0%  3.18MB/s ± 0%  +3.72%  (p=0.000 n=29+26)
      RegexpMatchHard_1K-4     3.35MB/s ± 0%  3.40MB/s ± 0%  +1.69%  (p=0.000 n=30+30)
      Revcomp-4                 101MB/s ± 0%   101MB/s ± 0%  -0.18%  (p=0.018 n=26+27)
      Template-4               4.92MB/s ± 4%  5.09MB/s ± 3%  +3.31%  (p=0.000 n=28+28)
      [Geo mean]               22.4MB/s       22.6MB/s       +0.62%
      
      Change-Id: I8f304b272785739f57b3c8f736316f658f8c1b2a
      Reviewed-on: https://go-review.googlesource.com/129119
      Run-TryBot: Ben Shi <powerman1st@163.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      b4442151
    • Ben Shi's avatar
      cmd/internal/obj/arm64: support more atomic instructions · 1018a80f
      Ben Shi authored
      LDADDALD(64-bit) and LDADDALW(32-bit) are already supported.
      This CL adds supports of LDADDALH(16-bit) and LDADDALB(8-bit).
      
      Change-Id: I4eac61adcec226d618dfce88618a2b98f5f1afe7
      Reviewed-on: https://go-review.googlesource.com/132135
      Run-TryBot: Ben Shi <powerman1st@163.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      1018a80f
    • Agniva De Sarker's avatar
      cmd/go/internal/modcmd: remove non-existent -dir flag · 55ef4460
      Agniva De Sarker authored
      Fixes #27243
      
      Change-Id: If9230244938dabd03b9afaa6600310df8f97fe92
      Reviewed-on: https://go-review.googlesource.com/131775Reviewed-by: 's avatarBryan C. Mills <bcmills@google.com>
      55ef4460
    • Matthew Dempsky's avatar
      cmd/compile: use "N variables but M values" error for OAS · f7a633aa
      Matthew Dempsky authored
      Makes the error message more consistent between OAS and OAS2.
      
      Fixes #26616.
      
      Change-Id: I07ab46c5ef8a37efb2cb557632697f5d1bf789f7
      Reviewed-on: https://go-review.googlesource.com/131280
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      f7a633aa
    • Alessandro Arzilli's avatar
      cmd/link: move dwarf part of DWARF generation before type name mangling · 9c833831
      Alessandro Arzilli authored
      Splits part of dwarfgeneratedebugsyms into a new function,
      dwarfGenerateDebugInfo which is called between deadcode elimination
      and type name mangling.
      This function takes care of collecting and processing the DIEs for
      all functions and package-level variables and also generates DIEs
      for all types used in the program.
      
      Fixes #23733
      
      Change-Id: I75ef0608fbed2dffc3be7a477f1b03e7e740ec61
      Reviewed-on: https://go-review.googlesource.com/111237
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarHeschi Kreinick <heschi@google.com>
      9c833831
    • Alexey Naidonov's avatar
      cmd/compile: remove unnecessary nil-check · 669fa8f3
      Alexey Naidonov authored
      Removes unnecessary nil-check when referencing offset from an
      address. Suggested by Keith Randall in golang/go#27180.
      
      Updates golang/go#27180
      
      Change-Id: I326ed7fda7cfa98b7e4354c811900707fee26021
      Reviewed-on: https://go-review.googlesource.com/131735Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      669fa8f3
    • Josh Bleecher Snyder's avatar
      cmd/compile: prefer rematerializeable arg0 for HMUL · 24e51bbe
      Josh Bleecher Snyder authored
      This prevents accidental regalloc regressions
      that otherwise can occur from unrelated changes.
      
      Change-Id: Iea356fb1a24766361fce13748dc1b46e57b21cea
      Reviewed-on: https://go-review.googlesource.com/129375
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      24e51bbe
    • Josh Bleecher Snyder's avatar
      encoding/binary: simplify Read and Write · 2179e495
      Josh Bleecher Snyder authored
      There's no need to manually manage the backing slice for bs.
      Removing it simplifies the code, removes some allocations,
      and speeds it up slightly.
      
      Fixes #27403
      
      name                     old time/op    new time/op    delta
      ReadSlice1000Int32s-8      6.39µs ± 1%    6.31µs ± 1%   -1.37%  (p=0.000 n=27+27)
      ReadStruct-8               1.25µs ± 2%    1.23µs ± 2%   -1.06%  (p=0.003 n=30+29)
      ReadInts-8                  301ns ± 0%     297ns ± 1%   -1.21%  (p=0.000 n=27+30)
      WriteInts-8                 325ns ± 1%     320ns ± 1%   -1.59%  (p=0.000 n=26+29)
      WriteSlice1000Int32s-8     6.60µs ± 0%    6.52µs ± 0%   -1.23%  (p=0.000 n=28+27)
      PutUint16-8                0.72ns ± 2%    0.71ns ± 2%     ~     (p=0.286 n=30+30)
      PutUint32-8                0.71ns ± 1%    0.71ns ± 0%   -0.42%  (p=0.003 n=30+25)
      PutUint64-8                0.78ns ± 2%    0.78ns ± 0%   -0.55%  (p=0.001 n=30+27)
      LittleEndianPutUint16-8    0.57ns ± 0%    0.57ns ± 0%     ~     (all equal)
      LittleEndianPutUint32-8    0.57ns ± 0%    0.57ns ± 0%     ~     (all equal)
      LittleEndianPutUint64-8    0.57ns ± 0%    0.57ns ± 0%     ~     (all equal)
      PutUvarint32-8             23.1ns ± 1%    23.1ns ± 1%     ~     (p=0.925 n=26+29)
      PutUvarint64-8             57.5ns ± 2%    57.3ns ± 1%     ~     (p=0.338 n=30+26)
      [Geo mean]                 23.0ns         22.9ns        -0.61%
      
      name                     old speed      new speed      delta
      ReadSlice1000Int32s-8     626MB/s ± 1%   634MB/s ± 1%   +1.38%  (p=0.000 n=27+27)
      ReadStruct-8             60.2MB/s ± 2%  60.8MB/s ± 2%   +1.08%  (p=0.002 n=30+29)
      ReadInts-8                100MB/s ± 1%   101MB/s ± 1%   +1.24%  (p=0.000 n=27+30)
      WriteInts-8              92.2MB/s ± 1%  93.6MB/s ± 1%   +1.56%  (p=0.000 n=26+29)
      WriteSlice1000Int32s-8    606MB/s ± 0%   614MB/s ± 0%   +1.24%  (p=0.000 n=28+27)
      PutUint16-8              2.80GB/s ± 1%  2.80GB/s ± 1%     ~     (p=0.095 n=28+29)
      PutUint32-8              5.61GB/s ± 1%  5.62GB/s ± 1%     ~     (p=0.069 n=27+28)
      PutUint64-8              10.2GB/s ± 1%  10.2GB/s ± 0%   +0.15%  (p=0.039 n=27+27)
      LittleEndianPutUint16-8  3.50GB/s ± 1%  3.50GB/s ± 1%     ~     (p=0.552 n=30+29)
      LittleEndianPutUint32-8  7.01GB/s ± 1%  7.02GB/s ± 1%     ~     (p=0.160 n=29+27)
      LittleEndianPutUint64-8  14.0GB/s ± 1%  14.0GB/s ± 1%     ~     (p=0.413 n=29+29)
      PutUvarint32-8            174MB/s ± 1%   173MB/s ± 1%     ~     (p=0.648 n=25+30)
      PutUvarint64-8            139MB/s ± 2%   140MB/s ± 1%     ~     (p=0.271 n=30+26)
      [Geo mean]                906MB/s        911MB/s        +0.55%
      
      name                     old alloc/op   new alloc/op   delta
      ReadSlice1000Int32s-8      4.14kB ± 0%    4.13kB ± 0%   -0.19%  (p=0.000 n=30+30)
      ReadStruct-8                 200B ± 0%      200B ± 0%     ~     (all equal)
      ReadInts-8                  64.0B ± 0%     32.0B ± 0%  -50.00%  (p=0.000 n=30+30)
      WriteInts-8                  112B ± 0%       64B ± 0%  -42.86%  (p=0.000 n=30+30)
      WriteSlice1000Int32s-8     4.14kB ± 0%    4.13kB ± 0%   -0.19%  (p=0.000 n=30+30)
      PutUint16-8                 0.00B          0.00B          ~     (all equal)
      PutUint32-8                 0.00B          0.00B          ~     (all equal)
      PutUint64-8                 0.00B          0.00B          ~     (all equal)
      LittleEndianPutUint16-8     0.00B          0.00B          ~     (all equal)
      LittleEndianPutUint32-8     0.00B          0.00B          ~     (all equal)
      LittleEndianPutUint64-8     0.00B          0.00B          ~     (all equal)
      PutUvarint32-8              0.00B          0.00B          ~     (all equal)
      PutUvarint64-8              0.00B          0.00B          ~     (all equal)
      [Geo mean]                   476B           370B       -22.22%
      
      name                     old allocs/op  new allocs/op  delta
      ReadSlice1000Int32s-8        3.00 ± 0%      2.00 ± 0%  -33.33%  (p=0.000 n=30+30)
      ReadStruct-8                 16.0 ± 0%      16.0 ± 0%     ~     (all equal)
      ReadInts-8                   8.00 ± 0%      8.00 ± 0%     ~     (all equal)
      WriteInts-8                  14.0 ± 0%      14.0 ± 0%     ~     (all equal)
      WriteSlice1000Int32s-8       3.00 ± 0%      2.00 ± 0%  -33.33%  (p=0.000 n=30+30)
      PutUint16-8                  0.00           0.00          ~     (all equal)
      PutUint32-8                  0.00           0.00          ~     (all equal)
      PutUint64-8                  0.00           0.00          ~     (all equal)
      LittleEndianPutUint16-8      0.00           0.00          ~     (all equal)
      LittleEndianPutUint32-8      0.00           0.00          ~     (all equal)
      LittleEndianPutUint64-8      0.00           0.00          ~     (all equal)
      PutUvarint32-8               0.00           0.00          ~     (all equal)
      PutUvarint64-8               0.00           0.00          ~     (all equal)
      [Geo mean]                   6.94           5.90       -14.97%
      
      Change-Id: I3790b93e4190d98621d5f2c47e42929a18f56c2e
      Reviewed-on: https://go-review.googlesource.com/133135
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      2179e495
    • Agniva De Sarker's avatar
      misc/wasm: handle error during instantiateStreaming · e2e44a5d
      Agniva De Sarker authored
      The same catch block is there in wasm_exec.js for node processes.
      Added it in browser invocations too, to prevent uncaught exceptions.
      
      Change-Id: Icab577ec585fa86df3c76db508b49401bcdb52ae
      Reviewed-on: https://go-review.googlesource.com/132916Reviewed-by: 's avatarRichard Musiol <neelance@gmail.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e2e44a5d
    • Leigh McCulloch's avatar
      go/types: correct misspelling in function doc · db3f52db
      Leigh McCulloch authored
      The indirectType function comment uses the phrase 'layed out'. In the
      context of that phrase, where something is being placed or sprawled,
      the word should be 'laid'. 'Layed' is a misspelling of 'laid'.
      
      Change-Id: I05ecb97637276e2252c47e92a0bd678130714889
      GitHub-Last-Rev: 6ee67371b42c12ceaf4c6c245319748008ac7e7b
      GitHub-Pull-Request: golang/go#27444
      Reviewed-on: https://go-review.googlesource.com/132779Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      db3f52db
  3. 03 Sep, 2018 7 commits
  4. 02 Sep, 2018 3 commits
    • Phil Pearl's avatar
      strings: simplify Join using Builder · 317afdc3
      Phil Pearl authored
      The existing implementation has a bunch of special cases and
      suffers an additional allocation for longer arrays. We can replace
      this code with a simple implementation using Builder, improve
      performance and reduce complexity.
      
      name      old time/op    new time/op    delta
      Join/0-8    3.53ns ± 3%    3.72ns ± 2%   +5.56%  (p=0.000 n=10+10)
      Join/1-8    3.94ns ± 4%    3.40ns ± 4%  -13.57%  (p=0.000 n=10+10)
      Join/2-8    57.0ns ± 3%    51.0ns ± 1%  -10.48%  (p=0.000 n=10+9)
      Join/3-8    74.9ns ± 2%    65.5ns ± 4%  -12.60%  (p=0.000 n=10+10)
      Join/4-8     105ns ± 0%      79ns ± 4%  -24.63%  (p=0.000 n=6+10)
      Join/5-8     116ns ± 2%      91ns ± 4%  -21.95%  (p=0.000 n=10+10)
      Join/6-8     131ns ± 1%     104ns ± 1%  -20.66%  (p=0.000 n=10+10)
      Join/7-8     141ns ± 0%     114ns ± 4%  -18.82%  (p=0.000 n=9+10)
      
      name      old alloc/op   new alloc/op   delta
      Join/0-8     0.00B          0.00B          ~     (all equal)
      Join/1-8     0.00B          0.00B          ~     (all equal)
      Join/2-8     16.0B ± 0%     16.0B ± 0%     ~     (all equal)
      Join/3-8     32.0B ± 0%     32.0B ± 0%     ~     (all equal)
      Join/4-8     96.0B ± 0%     48.0B ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/5-8     96.0B ± 0%     48.0B ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/6-8      128B ± 0%       64B ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/7-8      128B ± 0%       64B ± 0%  -50.00%  (p=0.000 n=10+10)
      
      name      old allocs/op  new allocs/op  delta
      Join/0-8      0.00           0.00          ~     (all equal)
      Join/1-8      0.00           0.00          ~     (all equal)
      Join/2-8      1.00 ± 0%      1.00 ± 0%     ~     (all equal)
      Join/3-8      1.00 ± 0%      1.00 ± 0%     ~     (all equal)
      Join/4-8      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/5-8      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/6-8      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/7-8      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      
      Change-Id: I866a50e809c398512cb87648c955eaa4bf4d8606
      Reviewed-on: https://go-review.googlesource.com/132895Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      317afdc3
    • Giovanni Bajo's avatar
      cmd/compile: add testcase for #24876 · dd5e9b32
      Giovanni Bajo authored
      This is still not fixed, the testcase reflects that there are still
      a few boundchecks. Let's fix the good alternative with an explicit
      test though.
      
      Updates #24876
      
      Change-Id: I4da35eb353e19052bd7b69ea6190a69ced8b9b3d
      Reviewed-on: https://go-review.googlesource.com/107355Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Giovanni Bajo <rasky@develer.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      dd5e9b32
    • Giovanni Bajo's avatar
      test: relax whitespaces matching in codegen tests · f02cc88f
      Giovanni Bajo authored
      The codegen testsuite uses regexp to parse the syntax, but it doesn't
      have a way to tell line comments containing checks from line comments
      containing English sentences. This means that any syntax error (that
      is, non-matching regexp) is currently ignored and not reported.
      
      There were some tests in memcombine.go that had an extraneous space
      and were thus effectively disabled. It would be great if we could
      report it as a syntax error, but for now we just punt and swallow the
      spaces as a workaround, to avoid the same mistake again.
      
      Fixes #25452
      
      Change-Id: Ic7747a2278bc00adffd0c199ce40937acbbc9cf0
      Reviewed-on: https://go-review.googlesource.com/113835
      Run-TryBot: Giovanni Bajo <rasky@develer.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      f02cc88f
  5. 01 Sep, 2018 2 commits
  6. 31 Aug, 2018 11 commits
  7. 30 Aug, 2018 5 commits
    • Robert Griesemer's avatar
      go/types: better names for internal helper functions (cleanup) · 770e37d2
      Robert Griesemer authored
      Internal helper functions for type-checking type expressions were
      renamed to make it clearer when they should be used:
      
      	typExpr (w/o def) -> typ
      	typExpr (w/  def) -> definedType
      	typ               -> indirectType
      	typExprInternal   -> typInternal
      
      The rename emphasizes that in most cases Checker.typ should be used
      to compute the types.Type from an ast.Type. If the type is defined,
      definedType should be used. For composite type elements which are
      not "inlined" in memory, indirectType should be used.
      
      In the process, implicitly changed several uses of indirectType
      (old: typ) to typ (old: typExpr) by not changing the respective
      function call source. These implicit changes are ok in those
      places because either call is fine where we are not concerned
      about composite type elements. But using typ (old: typExpr) is
      more efficient than using indirectType (old: typ).
      
      Change-Id: I4ad14d5357c5f94b6f1c33173de575c4cd05c703
      Reviewed-on: https://go-review.googlesource.com/130595Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      770e37d2
    • Robert Griesemer's avatar
      go/types: remove explicit path parameter from most type-checker functions (cleanup) · 43469ddf
      Robert Griesemer authored
      Now that most of the type-checker is using the object-coloring mechanism
      to detect cycles, remove the explicit path parameter from the functions
      that don't rely on it anymore.
      
      Some of the syntactic-based resolver code (for aliases, interfaces)
      still use an explicit path; leaving those unchanged for now.
      
      The function cycle was moved from typexpr.go (where it is not used
      anymore) to resolver.go (where it's still used). It has not changed.
      
      Fixes #25773.
      
      Change-Id: I2100adc8d66d5da9de9277dee94a1f08e5a88487
      Reviewed-on: https://go-review.googlesource.com/130476Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      43469ddf
    • Robert Griesemer's avatar
      go/types: track local cycles using same mechanism as for global objects · ce2e883a
      Robert Griesemer authored
      For Go 1.11, cycle tracking of global (package-level) objects was changed
      to use a Checker-level object path rather than relying on the explicit
      path parameter that is passed around to some (but not all) type-checker
      functions.
      
      This change now uses the same mechanism for the detection of local
      type cycles (local non-type objects cannot create cycles by definition
      of the spec).
      
      As a result, local alias cycles are now correctly detected as well
      (issue #27106).
      
      The path parameter that is explicitly passed around to some type-checker
      methods is still present and will be removed in a follow-up CL.
      
      Also:
      - removed useCycleMarking flag and respective dead code
      - added a couple more tests
      - improved documentation
      
      Fixes #27106.
      Updates #25773.
      
      Change-Id: I7cbf304bceb43a8d52e6483dcd0fa9ef7e1ea71c
      Reviewed-on: https://go-review.googlesource.com/130455
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      ce2e883a
    • Andrew Bonventre's avatar
      cmd/compile: make math/bits.RotateLeft* an intrinsic on amd64 · 5ac24767
      Andrew Bonventre authored
      Previously, pattern matching was good enough to achieve good performance
      for the RotateLeft* functions, but the inlining cost for them was much
      too high. Make RotateLeft* intrinsic on amd64 as a stop-gap for now to
      reduce inlining costs.
      
      This should be done (or at least looked at) for other architectures
      as well.
      
      Updates golang/go#17566
      
      Change-Id: I6a106ff00b6c4e3f490650af3e083ed2be00c819
      Reviewed-on: https://go-review.googlesource.com/132435
      Run-TryBot: Andrew Bonventre <andybons@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      5ac24767
    • Leigh McCulloch's avatar
      crypto/x509: clarify docs for SystemCertPool · 8201b92a
      Leigh McCulloch authored
      The sentence in the docs for SystemCertPool that states that mutations
      to a returned pool do not affect any other pool is ambiguous as to who
      the any other pools are, because pools can be created in multiple ways
      that have nothing to do with the system certificate pool. Also the use
      of the word 'the' instead of 'a' early in the sentence implies there is
      only one shared pool ever returned.
      
      Fixes #27385
      
      Change-Id: I43adbfca26fdd66c4adbf06eb85361139a1dea93
      GitHub-Last-Rev: 2f1ba09fa403d31d2d543dca15727c6c2f896ec7
      GitHub-Pull-Request: golang/go#27388
      Reviewed-on: https://go-review.googlesource.com/132378Reviewed-by: 's avatarFilippo Valsorda <filippo@golang.org>
      8201b92a