1. 15 Mar, 2018 10 commits
  2. 14 Mar, 2018 14 commits
    • Matthew Dempsky's avatar
      cmd/compile: cleanup closure.go · eb3c44b2
      Matthew Dempsky authored
      The main thing is we now eagerly create the ODCLFUNC node for
      closures, immediately cross-link them, and assign fields (e.g., Nbody,
      Dcl, Parents, Marks) directly on the ODCLFUNC (previously they were
      assigned on the OCLOSURE and later moved to the ODCLFUNC).
      
      This allows us to set Curfn to the ODCLFUNC instead of the OCLOSURE,
      which makes things more consistent with normal function declarations.
      (Notably, this means Cvars now hang off the ODCLFUNC instead of the
      OCLOSURE.)
      
      Assignment of xfunc symbol names also now happens before typechecking
      their body, which means debugging output now provides a more helpful
      name than "<S>".
      
      In golang.org/cl/66810, we changed "x := y" statements to avoid
      creating false closure variables for x, but we still create them for
      struct literals like "s{f: x}". Update comment in capturevars
      accordingly.
      
      More opportunity for cleanups still, but this makes some substantial
      progress, IMO.
      
      Passes toolstash-check.
      
      Change-Id: I65a4efc91886e3dcd1000561348af88297775cd7
      Reviewed-on: https://go-review.googlesource.com/100197
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      eb3c44b2
    • Ilya Tocar's avatar
      Revert "cmd/compile: implement CMOV on amd64" · 644d14ea
      Ilya Tocar authored
      This reverts commit 080187f4.
      
      It broke build of golang.org/x/exp/shiny/iconvg
      See issue 24395 for details
      
      Change-Id: Ifd6134f6214e6cee40bd3c63c32941d5fc96ae8b
      Reviewed-on: https://go-review.googlesource.com/100755
      Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      644d14ea
    • Heschi Kreinick's avatar
      cmd/compile/internal/ssa: track stack-only vars · 44e65f2c
      Heschi Kreinick authored
      User variables that cannot be SSA'd, either because their addresses are
      taken or because they are too large for the decomposition heuristic, do
      not explicitly appear as operands of SSA values. Instead they are written
      to directly via the stack pointer.
      
      This hid them from the location list generation, which is only
      interested in the named value table. Fortunately, the lifetime of
      stack-only variables is delineated by VarDef/VarKill ops, and it's easy
      enough to turn those into location list bounds.
      
      One wrinkle: stack frame information is not explicitly available in the
      SSA phases, because it's owned by the frontend in AllocFrame. It would
      be easier if the set of live LocalSlots were returned by that, but this
      is the minimal change to fix missing variables. Or VarDef/VarKills
      could appear in NamedValues, which would make this change even easier.
      
      Change-Id: Ice6654dad6f9babb0286e95c7ec28594561dc91f
      Reviewed-on: https://go-review.googlesource.com/100458Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      44e65f2c
    • Lynn Boger's avatar
      cmd/compile: improve PPC64.rules to reduce size of rewritePPC64.go · aff222cd
      Lynn Boger authored
      Some rules in PPC64.rules cause an extremely large rewritePPC64.go
      file to be generated, due to rules with commutative operations and
      many operands. This happens with the existing
      rules for combining byte loads in little endian order, and
      also happens with the pending change to do the same for bytes
      in big endian order.
      
      The change improves the existing rules and reduces the size of
      the rewrite file by more than 60%. Once this change is merged,
      then the pending change for big endian ordered rules will be
      updated to use rules that avoid generating an excessively large
      rewrite file.
      
      This also includes a fix to a performance regression for
      littleEndian.PutUint16 on ppc64le.
      
      Change-Id: I8d2ea42885fa2b84b30c63aa124b0a9b130564ff
      Reviewed-on: https://go-review.googlesource.com/100675
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      aff222cd
    • Robert Griesemer's avatar
      math/big: add comment about internal assumptions on nat values · 7d4d2cb6
      Robert Griesemer authored
      Change-Id: I7ed40507a019c0bf521ba748fc22c03d74bb17b7
      Reviewed-on: https://go-review.googlesource.com/100719Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      7d4d2cb6
    • Balaram Makam's avatar
      runtime: improve arm64 memclr implementation · b46d3988
      Balaram Makam authored
      Improve runtime memclr_arm64.s using ZVA feature to zero out memory when n
      is at least 64 bytes.
      
      Also add DCZID_EL0 system register to use in MRS instruction.
      
          Benchmark results of runtime/Memclr on Amberwing:
      name          old time/op    new time/op    delta
      Memclr/5        12.7ns ± 0%    12.7ns ± 0%      ~     (all equal)
      Memclr/16       12.7ns ± 0%    12.2ns ± 1%    -4.13%  (p=0.000 n=7+8)
      Memclr/64       14.0ns ± 0%    14.6ns ± 1%    +4.29%  (p=0.000 n=7+8)
      Memclr/256      23.7ns ± 0%    25.7ns ± 0%    +8.44%  (p=0.000 n=8+7)
      Memclr/4096      204ns ± 0%      74ns ± 0%   -63.71%  (p=0.000 n=8+8)
      Memclr/65536    2.89µs ± 0%    0.84µs ± 0%   -70.91%  (p=0.000 n=8+8)
      Memclr/1M       45.9µs ± 0%    17.0µs ± 0%   -62.88%  (p=0.000 n=8+8)
      Memclr/4M        184µs ± 0%      77µs ± 4%   -57.94%  (p=0.001 n=6+8)
      Memclr/8M        367µs ± 0%     144µs ± 1%   -60.72%  (p=0.000 n=7+8)
      Memclr/16M       734µs ± 0%     293µs ± 1%   -60.09%  (p=0.000 n=8+8)
      Memclr/64M      2.94ms ± 0%    1.23ms ± 0%   -58.06%  (p=0.000 n=7+8)
      GoMemclr/5      8.00ns ± 0%    8.79ns ± 0%    +9.83%  (p=0.000 n=8+8)
      GoMemclr/16     8.00ns ± 0%    7.60ns ± 0%    -5.00%  (p=0.000 n=8+8)
      GoMemclr/64     10.8ns ± 0%    10.4ns ± 0%    -3.70%  (p=0.000 n=8+8)
      GoMemclr/256    20.4ns ± 0%    21.2ns ± 0%    +3.92%  (p=0.000 n=8+8)
      
      name          old speed      new speed      delta
      Memclr/5       394MB/s ± 0%   393MB/s ± 0%    -0.28%  (p=0.006 n=8+8)
      Memclr/16     1.26GB/s ± 0%  1.31GB/s ± 1%    +4.07%  (p=0.000 n=7+8)
      Memclr/64     4.57GB/s ± 0%  4.39GB/s ± 2%    -3.91%  (p=0.000 n=7+8)
      Memclr/256    10.8GB/s ± 0%  10.0GB/s ± 0%    -7.95%  (p=0.001 n=7+6)
      Memclr/4096   20.1GB/s ± 0%  55.3GB/s ± 0%  +175.46%  (p=0.000 n=8+8)
      Memclr/65536  22.6GB/s ± 0%  77.8GB/s ± 0%  +243.63%  (p=0.000 n=7+8)
      Memclr/1M     22.8GB/s ± 0%  61.5GB/s ± 0%  +169.38%  (p=0.000 n=8+8)
      Memclr/4M     22.8GB/s ± 0%  54.3GB/s ± 4%  +137.85%  (p=0.001 n=6+8)
      Memclr/8M     22.8GB/s ± 0%  58.1GB/s ± 1%  +154.56%  (p=0.000 n=7+8)
      Memclr/16M    22.8GB/s ± 0%  57.2GB/s ± 1%  +150.54%  (p=0.000 n=8+8)
      Memclr/64M    22.8GB/s ± 0%  54.4GB/s ± 0%  +138.42%  (p=0.000 n=7+8)
      GoMemclr/5     625MB/s ± 0%   569MB/s ± 0%    -8.90%  (p=0.000 n=7+8)
      GoMemclr/16   2.00GB/s ± 0%  2.10GB/s ± 0%    +5.26%  (p=0.000 n=8+8)
      GoMemclr/64   5.92GB/s ± 0%  6.15GB/s ± 0%    +3.83%  (p=0.000 n=7+8)
      GoMemclr/256  12.5GB/s ± 0%  12.1GB/s ± 0%    -3.77%  (p=0.000 n=8+7)
      
          Benchmark results of runtime/Memclr on Amberwing without ZVA:
      name          old time/op    new time/op    delta
      Memclr/5        12.7ns ± 0%    12.8ns ± 0%   +0.79%  (p=0.008 n=5+5)
      Memclr/16       12.7ns ± 0%    12.7ns ± 0%     ~     (p=0.444 n=5+5)
      Memclr/64       14.0ns ± 0%    14.4ns ± 0%   +2.86%  (p=0.008 n=5+5)
      Memclr/256      23.7ns ± 1%    19.2ns ± 0%  -19.06%  (p=0.008 n=5+5)
      Memclr/4096      203ns ± 0%     119ns ± 0%  -41.38%  (p=0.008 n=5+5)
      Memclr/65536    2.89µs ± 0%    1.66µs ± 0%  -42.76%  (p=0.008 n=5+5)
      Memclr/1M       45.9µs ± 0%    26.2µs ± 0%  -42.82%  (p=0.008 n=5+5)
      Memclr/4M        184µs ± 0%     105µs ± 0%  -42.81%  (p=0.008 n=5+5)
      Memclr/8M        367µs ± 0%     210µs ± 0%  -42.76%  (p=0.008 n=5+5)
      Memclr/16M       734µs ± 0%     420µs ± 0%  -42.74%  (p=0.008 n=5+5)
      Memclr/64M      2.94ms ± 0%    1.69ms ± 0%  -42.46%  (p=0.008 n=5+5)
      GoMemclr/5      8.00ns ± 0%    8.40ns ± 0%   +5.00%  (p=0.008 n=5+5)
      GoMemclr/16     8.00ns ± 0%    8.40ns ± 0%   +5.00%  (p=0.008 n=5+5)
      GoMemclr/64     10.8ns ± 0%     9.6ns ± 0%  -11.02%  (p=0.008 n=5+5)
      GoMemclr/256    20.4ns ± 0%    17.2ns ± 0%  -15.69%  (p=0.008 n=5+5)
      
      name          old speed      new speed      delta
      Memclr/5       393MB/s ± 0%   391MB/s ± 0%   -0.64%  (p=0.008 n=5+5)
      Memclr/16     1.26GB/s ± 0%  1.26GB/s ± 0%   -0.55%  (p=0.008 n=5+5)
      Memclr/64     4.57GB/s ± 0%  4.44GB/s ± 0%   -2.79%  (p=0.008 n=5+5)
      Memclr/256    10.8GB/s ± 0%  13.3GB/s ± 0%  +23.07%  (p=0.016 n=4+5)
      Memclr/4096   20.1GB/s ± 0%  34.3GB/s ± 0%  +70.91%  (p=0.008 n=5+5)
      Memclr/65536  22.7GB/s ± 0%  39.6GB/s ± 0%  +74.65%  (p=0.008 n=5+5)
      Memclr/1M     22.8GB/s ± 0%  40.0GB/s ± 0%  +74.88%  (p=0.008 n=5+5)
      Memclr/4M     22.8GB/s ± 0%  39.9GB/s ± 0%  +74.84%  (p=0.008 n=5+5)
      Memclr/8M     22.9GB/s ± 0%  39.9GB/s ± 0%  +74.71%  (p=0.008 n=5+5)
      Memclr/16M    22.9GB/s ± 0%  39.9GB/s ± 0%  +74.64%  (p=0.008 n=5+5)
      Memclr/64M    22.8GB/s ± 0%  39.7GB/s ± 0%  +73.79%  (p=0.008 n=5+5)
      GoMemclr/5     625MB/s ± 0%   595MB/s ± 0%   -4.77%  (p=0.000 n=4+5)
      GoMemclr/16   2.00GB/s ± 0%  1.90GB/s ± 0%   -4.77%  (p=0.008 n=5+5)
      GoMemclr/64   5.92GB/s ± 0%  6.66GB/s ± 0%  +12.48%  (p=0.016 n=4+5)
      GoMemclr/256  12.5GB/s ± 0%  14.9GB/s ± 0%  +18.95%  (p=0.008 n=5+5)
      
      Fixes #22948
      
      Change-Id: Iaae4e22391e25b54d299821bb7f8a81ac3986b93
      Reviewed-on: https://go-review.googlesource.com/82055
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      b46d3988
    • Robert Griesemer's avatar
      cmd/compile: document new line directives · e65d6a6a
      Robert Griesemer authored
      Fixes #24183.
      
      Change-Id: I5ef31c4a3aad7e05568b7de1227745d686d4aff8
      Reviewed-on: https://go-review.googlesource.com/100462Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      e65d6a6a
    • Tobias Klauser's avatar
      runtime, syscall: add RawSyscall6 on Solaris and make it panic · f0939ba5
      Tobias Klauser authored
      The syscall package currently declares RawSyscall6 for every GOOS, but
      does not define it on Solaris. This leads to code using said function
      to compile but it will not link. Fix it by adding RawSyscall6 and make
      it panic.
      
      Also remove the obsolete comment above runtime.syscall_syscall as
      pointed out by Aram.
      
      Updates #24357
      
      Change-Id: I1b1423121d1c99de2ecc61cd9a935dba9b39e3a4
      Reviewed-on: https://go-review.googlesource.com/100655Reviewed-by: 's avatarAram Hăvărneanu <aram@mgk.ro>
      f0939ba5
    • Alberto Donizetti's avatar
      test/codegen: port all small memmove tests to codegen · cd3aae9b
      Alberto Donizetti authored
      This change ports all the remaining tests checking that small memmoves
      are replaced with MOVs to the new codegen test harness, and deletes
      them from the asm_test file.
      
      Change-Id: I01c94b441e27a5d61518035af62d62779dafeb56
      Reviewed-on: https://go-review.googlesource.com/100476
      Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      cd3aae9b
    • Alberto Donizetti's avatar
      test/codegen: add codegen tests for div · 858042b8
      Alberto Donizetti authored
      Change-Id: I6ce8981e85fd55ade6078b0946e54a9215d9deca
      Reviewed-on: https://go-review.googlesource.com/100575
      Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      858042b8
    • Daniel Martí's avatar
      cmd/asm: move manual tests out of generated file · b8d26225
      Daniel Martí authored
      Thanks to Iskander Sharipov for spotting this in an earlier CL of mine.
      
      Change-Id: Idf45ad266205ff83985367cb38f585badfbed151
      Reviewed-on: https://go-review.googlesource.com/100535
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      Reviewed-by: 's avatarIskander Sharipov <iskander.sharipov@intel.com>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      b8d26225
    • David du Colombier's avatar
      runtime: don't use floating point in findnull on Plan 9 · 523f2ea7
      David du Colombier authored
      In CL 98015, findnull was rewritten so it uses bytes.IndexByte.
      
      This broke the build on plan9/amd64 because the implementation
      of bytes.IndexByte on AMD64 relies on SSE instructions while
      floating point instructions are not allowed in the note handler.
      
      This change fixes findnull by using the former implementation
      on Plan 9, so it doesn't use bytes.IndexByte.
      
      Fixes #24387.
      
      Change-Id: I084d1a44d38d9f77a6c1ad492773f0a98226be16
      Reviewed-on: https://go-review.googlesource.com/100577
      Run-TryBot: David du Colombier <0intro@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRob Pike <r@golang.org>
      523f2ea7
    • Tobias Klauser's avatar
      test: check that size argument errors are emitted at call site · d32018a5
      Tobias Klauser authored
      Add tests for the "negative size argument in make.*" and "size argument
      too large in make.*" error messages to appear at call sites in case the
      size is a const defined on another line.
      
      As suggested by Matthew in a comment on CL 69910.
      
      Change-Id: I5c33d4bec4e3d20bb21fe8019df27999997ddff3
      Reviewed-on: https://go-review.googlesource.com/100395Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      d32018a5
    • Josh Bleecher Snyder's avatar
      runtime: fix typo in gdb script · 4d38d3ae
      Josh Bleecher Snyder authored
      Change-Id: I9d4b3e25b00724f0e4870c6082671b4f14cc18fc
      Reviewed-on: https://go-review.googlesource.com/100463
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      4d38d3ae
  3. 13 Mar, 2018 16 commits