1. 03 Apr, 2019 15 commits
  2. 02 Apr, 2019 12 commits
    • Agniva De Sarker's avatar
      image/jpeg: reduce bound checks from idct and fdct · 64f22e4b
      Agniva De Sarker authored
      Before -
      $gotip build -gcflags="-d=ssa/check_bce/debug=1" fdct.go idct.go
      ./fdct.go:89:10: Found IsInBounds
      ./fdct.go:90:10: Found IsInBounds
      ./fdct.go:91:10: Found IsInBounds
      ./fdct.go:92:10: Found IsInBounds
      ./fdct.go:93:10: Found IsInBounds
      ./fdct.go:94:10: Found IsInBounds
      ./fdct.go:95:10: Found IsInBounds
      ./fdct.go:96:10: Found IsInBounds
      ./idct.go:77:9: Found IsInBounds
      ./idct.go:77:27: Found IsInBounds
      ./idct.go:77:45: Found IsInBounds
      ./idct.go:78:7: Found IsInBounds
      ./idct.go:78:25: Found IsInBounds
      ./idct.go:78:43: Found IsInBounds
      ./idct.go:78:61: Found IsInBounds
      ./idct.go:79:13: Found IsInBounds
      ./idct.go:92:13: Found IsInBounds
      ./idct.go:93:12: Found IsInBounds
      ./idct.go:94:12: Found IsInBounds
      ./idct.go:95:12: Found IsInBounds
      ./idct.go:97:12: Found IsInBounds
      ./idct.go:98:12: Found IsInBounds
      ./idct.go:99:12: Found IsInBounds
      
      After -
      $gotip build -gcflags="-d=ssa/check_bce/debug=1" fdct.go idct.go
      ./fdct.go:90:9: Found IsSliceInBounds
      ./idct.go:76:11: Found IsSliceInBounds
      ./idct.go:145:11: Found IsSliceInBounds
      
      name                 old time/op    new time/op    delta
      FDCT-4                 1.85µs ± 2%    1.74µs ± 1%  -5.95%  (p=0.000 n=10+10)
      IDCT-4                 1.94µs ± 2%    1.89µs ± 1%  -2.67%  (p=0.000 n=10+9)
      DecodeBaseline-4       1.45ms ± 2%    1.46ms ± 1%    ~     (p=0.156 n=9+10)
      DecodeProgressive-4    2.21ms ± 1%    2.21ms ± 1%    ~     (p=0.796 n=10+10)
      EncodeRGBA-4           24.9ms ± 1%    25.0ms ± 1%    ~     (p=0.075 n=10+10)
      EncodeYCbCr-4          26.1ms ± 1%    26.2ms ± 1%    ~     (p=0.573 n=8+10)
      
      name                 old speed      new speed      delta
      DecodeBaseline-4     42.5MB/s ± 2%  42.4MB/s ± 1%    ~     (p=0.162 n=9+10)
      DecodeProgressive-4  27.9MB/s ± 1%  27.9MB/s ± 1%    ~     (p=0.796 n=10+10)
      EncodeRGBA-4         49.4MB/s ± 1%  49.1MB/s ± 1%    ~     (p=0.066 n=10+10)
      EncodeYCbCr-4        35.3MB/s ± 1%  35.2MB/s ± 1%    ~     (p=0.586 n=8+10)
      
      name                 old alloc/op   new alloc/op   delta
      DecodeBaseline-4       63.0kB ± 0%    63.0kB ± 0%    ~     (all equal)
      DecodeProgressive-4     260kB ± 0%     260kB ± 0%    ~     (all equal)
      EncodeRGBA-4           4.40kB ± 0%    4.40kB ± 0%    ~     (all equal)
      EncodeYCbCr-4          4.40kB ± 0%    4.40kB ± 0%    ~     (all equal)
      
      name                 old allocs/op  new allocs/op  delta
      DecodeBaseline-4         5.00 ± 0%      5.00 ± 0%    ~     (all equal)
      DecodeProgressive-4      13.0 ± 0%      13.0 ± 0%    ~     (all equal)
      EncodeRGBA-4             4.00 ± 0%      4.00 ± 0%    ~     (all equal)
      EncodeYCbCr-4            4.00 ± 0%      4.00 ± 0%    ~     (all equal)
      
      Updates #24499
      
      Change-Id: I6828d077b851817503a7c1a08235763f81bdadf9
      Reviewed-on: https://go-review.googlesource.com/c/go/+/167417
      Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarNigel Tao <nigeltao@golang.org>
      64f22e4b
    • Ian Lance Taylor's avatar
      misc/cgo/testcarchive: skip TestSignalForwardingExternal on darwin/amd64 · 2da96591
      Ian Lance Taylor authored
      On darwin/amd64 the runtime method sigctxt.fixsigcode changes SIGSEGV
      signals so that they are never marked SI_USER. CL 169120 changed the
      signal handler to call fixsigcode even when the signal is delivered to
      a non-Go thread. This breaks TestSignalForwardingExternal, so skip it.
      
      Change-Id: I6740fb5a8f4f854ca69793537a983a696da3b495
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170446
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2da96591
    • Elias Naur's avatar
      runtime/cgo: look for android_get_device_api_level in libc.so · fc7ac2e8
      Elias Naur authored
      The presence of the android_get_device_api_level symbol is used to
      detect Android Q or later. Use the suggestion by Ryan Prichard and
      look for it in libc.so and not in the entire program where someone
      else might have defined it.
      
      Manually tested on an Android Q amd64 emulator and arm64 Pixel.
      
      Updates #29674
      
      Change-Id: Iaef35d8f8910037b3690aa21f319e216a05a9a73
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170127
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      fc7ac2e8
    • Matthew Dempsky's avatar
      runtime/internal/atomic: fix wasm's StorepNoWB implementation · 814c97b3
      Matthew Dempsky authored
      Package unsafe's safety rules require that pointers converted to
      uintptr must be converted back to pointer-type before being stored
      into memory. In particular, storing a pointer into a non-pointer-typed
      expression does not guarantee the pointer stays valid, even if the
      expression refers to a pointer-typed variable.
      
      wasm's StorepNoWB implementation violates these rules by storing a
      pointer through a uintptr-typed expression.
      
      This happens to work today because esc.go is lenient in its
      implementation of package unsafe's rules, but my escape analysis
      rewrite follows them more rigorously, which causes val to be treated
      as a non-leaking parameter.
      
      This CL fixes the issue by using a *T-typed expression, where T is
      marked //go:notinheap so that the compiler still omits the write
      barrier as appropriate.
      
      Updates #23109.
      
      Change-Id: I49bc5474dbaa95729e5c93201493afe692591bc8
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170323
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      814c97b3
    • Joel Sing's avatar
      crypto/tls: simplify intermediate certificate handling · 20389553
      Joel Sing authored
      The certificates argument to verifyServerCertificate must contain
      at least one certificate. Simplify the intermediate certificate
      handling code accordingly.
      
      Change-Id: I8292cdfb51f418e011d6d97f47d10b4e631aa932
      Reviewed-on: https://go-review.googlesource.com/c/go/+/169657Reviewed-by: default avatarFilippo Valsorda <filippo@golang.org>
      20389553
    • Bryan C. Mills's avatar
      cmd/go/internal/web2: make netrc parsing more robust · 2d683807
      Bryan C. Mills authored
      - Respect the NETRC environment variable if set.
      
      - Ignore lines that contain macro definitions.
      
      - Associate the 'machine' token with only the tokens that follow (not
        precede) it.
      
      Updates #29888
      Updates #26232
      
      Change-Id: I3128b7d6da2d6492df7c864e165eea1a27384f0f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/161698
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      2d683807
    • Matthew Dempsky's avatar
      cmd/compile: trim more unnecessary escape analysis messages · 131eb8fb
      Matthew Dempsky authored
      "leaking closure reference" is redundant for similar reasons as "&x
      escapes to heap" for OADDR nodes: the reference itself does not
      allocate, and we already report when the referenced variable is moved
      to heap.
      
      "mark escaped content" is redundant with "leaking param content".
      
      Updates #23109.
      
      Change-Id: I1ab599cb1e8434f1918dd80596a70cba7dc8a0cf
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170321
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      131eb8fb
    • Alessandro Arzilli's avatar
      compile,link: export package name in debug_info · e29f74ef
      Alessandro Arzilli authored
      Add a new custom attribute to compile units containing the package name
      of the package (i.e. the name after the 'package' keyword), so that
      debuggers can know it when it's different from the last segment
      of the package path.
      
      Change-Id: Ieadaab6f47091aabf2f4dc42c8524452eaa6715b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/163677
      Run-TryBot: Alessandro Arzilli <alessandro.arzilli@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarHeschi Kreinick <heschi@google.com>
      e29f74ef
    • Matthew Dempsky's avatar
      cmd/compile: skip escape analysis diagnostics for OADDR · abefcac1
      Matthew Dempsky authored
      For most nodes (e.g., OPTRLIT, OMAKESLICE, OCONVIFACE), escape
      analysis prints "escapes to heap" or "does not escape" to indicate
      whether that node's allocation can be heap or stack allocated.
      
      These messages are also emitted for OADDR, even though OADDR does not
      actually allocate anything itself. Moreover, it's redundant because
      escape analysis already prints "moved to heap" diagnostics when an
      OADDR node like "&x" causes x to require heap allocation.
      
      Because OADDR nodes don't allocate memory, my escape analysis rewrite
      doesn't naturally emit the "escapes to heap" / "does not escape"
      diagnostics for them. It's also non-trivial to replicate the exact
      semantics esc.go uses for OADDR.
      
      Since there are so many of these messages, I'm disabling them in this
      CL by themselves. I modified esc.go to suppress the Warnl calls
      without any other behavior changes, and then used a shell script to
      automatically remove any ERROR messages mentioned by run.go in
      "missing error" or "no match for" lines.
      
      Fixes #16300.
      Updates #23109.
      
      Change-Id: I3993e2743c3ff83ccd0893f4e73b366ff8871a57
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170319
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      abefcac1
    • Mark Ryan's avatar
      cmd/asm: Fix EVEX RIP-relative addressing · 4ebc6514
      Mark Ryan authored
      AVX-512 instructions that use RIP-relative addressing and require the
      R bit of the EVEX prefix to be zero, i.e., instructions that use Z8-Z15 or
      Z24-Z31, are incorrectly encoded by the assembler.  The reason is that
      the location of the offset at which the relative address is to be written
      is incorrectly computed when the R bit is clear.
      
      For example,
      
      VMOVUPS bInitX<>+0(SB), Z0
      
      encodes correctly to
      
      62 f1 7c 48 10 05 66 e9 02 00
      
      whereas
      
      VMOVUPS bInitX<>+0(SB), Z8
      
      encodes incorrectly to
      
      62 71 7c 48 10 05 00 56 e9 02 00
      
      Note the extra zero byte between the ModR/M byte (05) and the relative
      address starting with 56.  This error results in the first byte of the
      following instruction being overwritten and typically, a program crash.
      
      This commit fixes the issue in the same way that is fixed for VEX encoded
      instructions, by simply not incrementing the offset for EVEX instructions.
      Existing test code created for a similar VEX encoding issue (19518) has
      been modified to also test for the issue addressed by this commit.
      
      Fixes #31001
      
      Change-Id: If84719ac22ebb5fb3c42ff96cd32b611ad497414
      Reviewed-on: https://go-review.googlesource.com/c/go/+/168562
      Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIlya Tocar <ilya.tocar@intel.com>
      4ebc6514
    • Clément Chigot's avatar
      runtime, cmd/dist, misc/cgo: enable c-archive for aix/ppc64 · 3aacfce6
      Clément Chigot authored
      Change-Id: Ib9a40d5596f5735a00483e2d2db965402f05671b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/169120
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      3aacfce6
    • Tobias Klauser's avatar
      internal/bytealg: fix function reference in comments · 56517216
      Tobias Klauser authored
      There's no IndexShortStr func, refer to Index instead.
      
      Change-Id: I6923e7ad3e910e4b5fb0c07d6339ddfec4111f4f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170124
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      56517216
  3. 01 Apr, 2019 5 commits
    • Brad Fitzpatrick's avatar
      runtime: skip broken TestLldbPython · 46c3e217
      Brad Fitzpatrick authored
      It's broken on our builders (once we enabled dev mode on our Macs,
      see CL 170339)
      
      Updates #31188
      
      Change-Id: Iceea65dc79576057b401a461bfe39254fed1f7ed
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170281Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      46c3e217
    • Michael Munday's avatar
      cmd/compile/internal/gc: minor cleanup of slicing · 726a9398
      Michael Munday authored
      Tidy the code up a little bit to move variable definitions closer
      to uses, prefer early return to else branches and some other minor
      tweaks.
      
      I'd like to make some more changes to this code in the near future
      and this CL should make those changes cleaner.
      
      Change-Id: Ie7d7f2e4bb1e670347941e255c9cdc1703282db5
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170120
      Run-TryBot: Michael Munday <mike.munday@ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      726a9398
    • LE Manh Cuong's avatar
      cmd/compile: use FmtLeft to generate symbol name for unexported interface methods · 5fc55b31
      LE Manh Cuong authored
      The bug in 29612 is that there are two similar-looking anonymous interface
      types in two different packages, ./p1/ssa and ./p2/ssa:
      
      v.(interface{ foo() }).foo()
      
      These types should be treated differently because the unexported method
      makes the types different (according to the spec).
      
      But when generating the type descriptors for those two types, they
      both have the name "interface { ssa.foo() }". They thus get the same
      symbol, and the linker happily unifies them. It picks an arbitrary one
      for the runtime to use, but that breaks conversions from concrete types
      that have a foo method from the package which had its interface type
      overwritten.
      
      We need to encode the metadata symbol for unexported methods as package
      path qualified (The same as we did in CL 27791 for struct fields).
      
      So switching from FmtUnsigned to Fmtleft by default fixes the issue.
      In case of generating namedata, FmtUnsigned is used.
      
      The benchmark result ends up in no significant change of compiled binary
      compare to the immediate parent.
      
      Fixes #29612
      
      Change-Id: I775aff91ae4a1bb16eb18a48d55e3b606f3f3352
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170157Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      5fc55b31
    • Bryan C. Mills's avatar
      cmd/go/internal/modget: support the suffix '@patch' in 'go get' · a7fc7109
      Bryan C. Mills authored
      As of this change, an explicit '@patch' suffix is to '-u=patch' as
      '@latest' is to '-u'.
      
      RELNOTE='go get' in module mode now supports the version suffix '@patch'.
      
      Fixes #26812
      
      Change-Id: Ib5eee40de640440f7470d37a574b311ef8a67f67
      Reviewed-on: https://go-review.googlesource.com/c/go/+/167747
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      a7fc7109
    • Jay Conrod's avatar
      cmd/go: refactor load.LoadPackage into other functions · d6b2b35e
      Jay Conrod authored
      LoadPackage was used to load a *load.Package for a command line
      argument, after pattern expansion. It provided two special cases on
      top of LoadImport. First, it ensured that "cmd/" packages in GOROOT
      were installed in "$GOROOT/bin" or "$GOROOT/pkg/tool". Second, it
      translated absolute paths to packages in GOROOT and GOPATH into
      regular import paths.
      
      With this change, LoadImport now ensures "cmd/" packages have the
      right Target (without the need for a special case) and
      search.ImportPaths translates absolute paths.
      
      LoadPackage no longer handles these special cases and has been renamed
      to LoadImportWithFlags, since it's still useful for loading implicit
      dependencies.
      
      Updates #29758
      
      Change-Id: I9d54036f90c3ccd9b3a0fe0eaddaa7749593cc91
      Reviewed-on: https://go-review.googlesource.com/c/go/+/167748
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      d6b2b35e
  4. 31 Mar, 2019 4 commits
    • Segev Finer's avatar
      cmd/doc: correctly indent pre-formatted blocks · 4091cf97
      Segev Finer authored
      They were previously indented at the same level as the normal text when
      printing a single symbol or the description of a field.
      
      Running "go doc text/template Must":
      Before:
          func Must(t *Template, err error) *Template
              Must is a helper that wraps a call to a function returning (*Template,
              error) and panics if the error is non-nil. It is intended for use in
              variable initializations such as
      
              var t = template.Must(template.New("name").Parse("text"))
      
      After:
          func Must(t *Template, err error) *Template
              Must is a helper that wraps a call to a function returning (*Template,
              error) and panics if the error is non-nil. It is intended for use in
              variable initializations such as
      
                  var t = template.Must(template.New("name").Parse("text"))
      
      Running "go doc http Request.Header":
      Before:
          type Request struct {
              // Header contains the request header fields either received
              // by the server or to be sent by the client.
              //
              // If a server received a request with header lines,
              //
              // Host: example.com
              // accept-encoding: gzip, deflate
              // Accept-Language: en-us
              // fOO: Bar
              // foo: two
              //
              // then
              //
              // Header = map[string][]string{
              // "Accept-Encoding": {"gzip, deflate"},
              // "Accept-Language": {"en-us"},
              // "Foo": {"Bar", "two"},
              // }
              ...
      
      After:
          type Request struct {
              // Header contains the request header fields either received by the server or
              // to be sent by the client.
              //
              // If a server received a request with header lines,
              //
              //     Host: example.com
              //     accept-encoding: gzip, deflate
              //     Accept-Language: en-us
              //     fOO: Bar
              //     foo: two
              //
              // then
              //
              //     Header = map[string][]string{
              //          "Accept-Encoding": {"gzip, deflate"},
              //          "Accept-Language": {"en-us"},
              //          "Foo": {"Bar", "two"},
              //     }
              ...
      
      Fixes #29708
      
      Change-Id: Ibe1a6a7a76d6b19c5737ba6e8210e3ad0b88ce16
      GitHub-Last-Rev: 439c0fe70a01490cbd9c3613eba3fe45a3ffd9be
      GitHub-Pull-Request: golang/go#31120
      Reviewed-on: https://go-review.googlesource.com/c/go/+/169957
      Run-TryBot: Rob Pike <r@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRob Pike <r@golang.org>
      4091cf97
    • zdjones's avatar
      cmd/compile: update stale comment in prove · c1783896
      zdjones authored
      This is a follow-up CL to https://golang.org/cl/170118, updating a comment made
      incorrect by that CL.
      
      Change-Id: I5a29cfae331fbbbb36c96d96f9e4949393a5942d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170123Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      c1783896
    • Michael Munday's avatar
      runtime: always mask shift amount regardless of architecture · 7b62e984
      Michael Munday authored
      Currently the shift amount is only masked on x86. Change it so it
      is masked on all architectures. In the worst case we generate a
      couple of extra instructions to perform the masking and in the best
      case we can elide overflow checks.
      
      This particular shift could also be replaced with a rotate
      instruction during optimization which would remove both the masking
      instructions and overflow checks on all architectures.
      
      Fixes #31165.
      
      Change-Id: I16b7a8800b4ba8813dc83735dfc59564e661d3b4
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170122
      Run-TryBot: Michael Munday <mike.munday@ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      7b62e984
    • Daniel Martí's avatar
      cmd/go: further reduce init work · e6ad619a
      Daniel Martí authored
      The first biggest offender was crypto/des.init at ~1%. It's
      cryptographically broken and the init function is relatively expensive,
      which is unfortunate as both crypto/tls and crypto/x509 (and by
      extension, cmd/go) import it. Hide the work behind sync.Once.
      
      The second biggest offender was flag.sortFlags at just under 1%, used by
      the Visit flagset methods. It allocated two slices, which made a
      difference as cmd/go iterates over multiple flagsets during init.
      Use a single slice with a direct sort.Interface implementation.
      
      Another big offender is initializing global maps. Reducing this work in
      cmd/go/internal/imports and net/textproto gives us close to another
      whole 1% in saved work. The former can use map literals, and the latter
      can hide the work behind sync.Once.
      
      Finally, compress/flate used newHuffmanBitWriter as part of init, which
      allocates many objects and slices. Yet it only used one of the slice
      fields. Allocating just that slice saves a surprising ~0.3%, since we
      generated a lot of unnecessary garbage.
      
      All in all, these little pieces amount to just over 3% saved CPU time.
      
      name         old time/op  new time/op  delta
      ExecGoEnv-8  3.61ms ± 1%  3.50ms ± 0%  -3.02%  (p=0.000 n=10+10)
      
      Updates #26775.
      Updates #29382.
      
      Change-Id: I915416e88a874c63235ba512617c8aef35c0ca8b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/166459
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      e6ad619a
  5. 30 Mar, 2019 3 commits
  6. 29 Mar, 2019 1 commit
    • zdjones's avatar
      cmd/compile: preempt repeated checks for the zero constant in prove · 576442b2
      zdjones authored
      Prove requires access to a zero-valued constant in multiple heavily-used
      code paths. Currently, prove is checking for the existence of the constant on
      every iteration of these paths, and creating it if not found.
      
      This CL preempts all of these checks by finding or creating the zero constant
      Value, just once, when the factsTable is initialised on entry to prove(). The
      Method used to initialise the zero constant, func.ConstInt64(), finds an
      existing constant if present, or creates one in the entry block otherwise.
      
      Fixes #31141
      
      Change-Id: Ic9a2fd9d79b67025e24d4483f6e87cf8213ead24
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170118Reviewed-by: default avatarGiovanni Bajo <rasky@develer.com>
      Run-TryBot: Giovanni Bajo <rasky@develer.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      576442b2