- 14 Mar, 2019 23 commits
-
-
Matthew Dempsky authored
This logic is used by the current escape analysis pass, but otherwise logically independent. Move (unchanged) into a separate file to make that clearer, and to make it easier to replace esc.go later. Updates #23109. Change-Id: Iec8c0c47ea04c0008165791731c11d9104d5a474 Reviewed-on: https://go-review.googlesource.com/c/go/+/167715Reviewed-by: Robert Griesemer <gri@golang.org>
-
Matthew Dempsky authored
This is a re-attempt at CL 153841, which caused two regressions: 1. crypto/ecdsa failed to build with -gcflags=-l=4. This was because when "t1, t2, ... := g(); f(t1, t2, ...)" was exported, we were losing the first assignment from the call's Ninit field. 2. net/http/pprof failed to run with -gcflags=-N. This is due to a conflict with CL 159717: as of that CL, package-scope initialization statements are executed within the "init.ializer" function, rather than the "init" function, and the generated temp variables need to be moved accordingly too. [Rest of description is as before.] This CL moves order.go's copyRet logic for rewriting f(g()) into t1, t2, ... := g(); f(t1, t2, ...) earlier into typecheck. This allows the rest of the compiler to stop worrying about multi-value functions appearing outside of OAS2FUNC nodes. This changes compiler behavior in a few observable ways: 1. Typechecking error messages for builtin functions now use general case error messages rather than unnecessarily differing ones. 2. Because f(g()) is rewritten before inlining, saved inline bodies now see the rewritten form too. This could be addressed, but doesn't seem worthwhile. 3. Most notably, this simplifies escape analysis and fixes a memory corruption issue in esc.go. See #29197 for details. Fixes #15992. Fixes #29197. Change-Id: I930b10f7e27af68a0944d6c9bfc8707c3fab27a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/166983 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Andrew Bonventre authored
Change-Id: I0d4a55af0bee754ab1ee817780027e9f72475afb Reviewed-on: https://go-review.googlesource.com/c/go/+/167711Reviewed-by: Katie Hockman <katiehockman@google.com> Reviewed-by: Katie Hockman <katie@golang.org>
-
Richard Musiol authored
This commit adds compiler intrinsics for the packages math and math/bits on the wasm architecture for better performance. benchmark old ns/op new ns/op delta BenchmarkCeil 8.31 3.21 -61.37% BenchmarkCopysign 5.24 3.88 -25.95% BenchmarkAbs 5.42 3.34 -38.38% BenchmarkFloor 8.29 3.18 -61.64% BenchmarkRoundToEven 9.76 3.26 -66.60% BenchmarkSqrtLatency 8.13 4.88 -39.98% BenchmarkSqrtPrime 5246 3535 -32.62% BenchmarkTrunc 8.29 3.15 -62.00% BenchmarkLeadingZeros 13.0 4.23 -67.46% BenchmarkLeadingZeros8 4.65 4.42 -4.95% BenchmarkLeadingZeros16 7.60 4.38 -42.37% BenchmarkLeadingZeros32 10.7 4.48 -58.13% BenchmarkLeadingZeros64 12.9 4.31 -66.59% BenchmarkTrailingZeros 6.52 4.04 -38.04% BenchmarkTrailingZeros8 4.57 4.14 -9.41% BenchmarkTrailingZeros16 6.69 4.16 -37.82% BenchmarkTrailingZeros32 6.97 4.23 -39.31% BenchmarkTrailingZeros64 6.59 4.00 -39.30% BenchmarkOnesCount 7.93 3.30 -58.39% BenchmarkOnesCount8 3.56 3.19 -10.39% BenchmarkOnesCount16 4.85 3.19 -34.23% BenchmarkOnesCount32 7.27 3.19 -56.12% BenchmarkOnesCount64 8.08 3.28 -59.41% BenchmarkRotateLeft 4.88 3.80 -22.13% BenchmarkRotateLeft64 5.03 3.63 -27.83% Change-Id: Ic1e0c2984878be8defb6eb7eb6ee63765c793222 Reviewed-on: https://go-review.googlesource.com/c/go/+/165177 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Derek Phan authored
The return values are integers, as opposed to floats, since the fractionals can be derived from multiplying t.Seconds(). Fixes #28564 Change-Id: I3796227e1f64ead39ff0aacfbdce912d952f2994 GitHub-Last-Rev: b843ab740bf5a8216478322533521d6243fe1cb1 GitHub-Pull-Request: golang/go#30819 Reviewed-on: https://go-review.googlesource.com/c/go/+/167387 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Andrew Bonventre authored
Change-Id: I6d3a615c5f72e9aa29d23e127af98d6e836da173 Reviewed-on: https://go-review.googlesource.com/c/go/+/167699Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Andrew Bonventre authored
Change-Id: I99832fa4f2c3ec28e2dad46cf7607f3766948031 Reviewed-on: https://go-review.googlesource.com/c/go/+/167698Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
CL 163760 was submitted with this file generated from an old version of the code generator. Change-Id: I9a3b9a48f794f74567f82ef58637cb1820befd11 Reviewed-on: https://go-review.googlesource.com/c/go/+/167677Reviewed-by: Richard Musiol <neelance@gmail.com>
-
Richard Musiol authored
TryBot is sometimes running into deadlocks on js/wasm. We haven't been able to reproduce them yet. This workaround is an experiment to resolve these deadlocks by retrying a missed timeout event. A timeout event is scheduled by Go to be woken by JavaScript after a certain amount of time. The checkTimeouts function then checks which notes to wake by comparing their deadline to nanotime. If this check fails erroneously then the note may stay asleep forever, causing a deadlock. This may or may not be the reason of the observed deadlocks. Updates #28975. Change-Id: I46b9d4069307142914f0e7b3acd4e65578319f0b Reviewed-on: https://go-review.googlesource.com/c/go/+/167119Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Patrick Barker authored
Checks that specs exist before attempting to access the first element in genDecl printer. Change-Id: I3619bcabf6fec64c88b7a10cdb7be355e9e40559 GitHub-Last-Rev: 54cf699c969cb88cfd269f847a2bb4f25916be94 GitHub-Pull-Request: golang/go#30823 Reviewed-on: https://go-review.googlesource.com/c/go/+/167390Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Carlos Eduardo Seo authored
Extends CL 132435 to ppc64x. ppc64x has 32- and 64-bit variable rotate left instructions. name old time/op new time/op delta RotateLeft32-16 1.39ns ± 0% 1.37ns ± 0% -1.44% (p=0.008 n=5+5) RotateLeft64-16 1.35ns ± 0% 1.32ns ± 0% -2.22% (p=0.008 n=5+5) Updates #17566 Change-Id: I567f634ff90d0691db45df0a25c99fcdfe10ca00 Reviewed-on: https://go-review.googlesource.com/c/go/+/163760Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
-
Bryan C. Mills authored
This reverts CL 166985, restoring CL 162698. The bootstrap failure from CL 162698 was fixed in CL 167077 and CL 167078. Fixes #30228 Change-Id: I5a4e3081018c51b74b67185e64f20a9c824a564e Reviewed-on: https://go-review.googlesource.com/c/go/+/167087 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
-
Carlos Eduardo Seo authored
A bug in the encoding of XX1-Form is flipping bit 31 of such instructions. This may result in register clobering when using VSX instructions. This was not exposed before because we currently don't generate these instructions in SSA, and the asm files in which they are present aren't affected by register clobbering. This change fixes the bug and adds a testcase for the problem. Fixes #30112 Change-Id: I77b606159ae1efea33d2ba3e1c74b7fae8d5d2e7 Reviewed-on: https://go-review.googlesource.com/c/go/+/163759Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Marcel van Lohuizen authored
This applies only for cases where %w is not used. The purpose of this change is to reduce test failures where tests depend on these two being the same type, as they previously were. Change-Id: I2dd28b93fe1d59f3cfbb4eb0875d1fb8ee699746 Reviewed-on: https://go-review.googlesource.com/c/go/+/167402 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
-
Marcel van Lohuizen authored
See Issue #29382 and Issue #30468. Improvements in this CL: name old time/op new time/op delta New-8 352ns ± 2% 225ns ± 5% -36.04% (p=0.008 n=5+5) Improvements together with moving to 1 uintptr: name old time/op new time/op delta New-8 475ns ± 3% 225ns ± 5% -52.59% (p=0.008 n=5+5) Change-Id: I9d69a14e5e10a6498767defb7d5f26ceedcf9ba5 Reviewed-on: https://go-review.googlesource.com/c/go/+/167401 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
-
Marcel van Lohuizen authored
See Issue #29382 and Issue #30468. 3 frames are no longer needed as of https://go-review.googlesource.com/c/go/+/152537/ name old time/op new time/op delta New-8 475ns ± 3% 352ns ± 2% -25.87% (p=0.008 n=5+5) Errorf/no_format-8 661ns ± 4% 558ns ± 2% -15.63% (p=0.008 n=5+5) Errorf/with_format-8 729ns ± 6% 626ns ± 2% -14.23% (p=0.008 n=5+5) Errorf/method:_mytype-8 1.00µs ± 9% 0.84µs ± 2% -15.94% (p=0.008 n=5+5) Errorf/method:_number-8 1.25µs ± 7% 1.04µs ± 2% -16.38% (p=0.008 n=5+5) Change-Id: I30377e769b3b3be623f63ecbe365f8950ca08dda Reviewed-on: https://go-review.googlesource.com/c/go/+/167400 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
-
Marcel van Lohuizen authored
This is a refinement of CL 164557. Make it explicit in tests that using a non-string verb with fmtError does not result in falling back to using fmt.Formatter. Change-Id: I6d090f31818eb7cc7668d7565b1449c91cd03a23 Reviewed-on: https://go-review.googlesource.com/c/go/+/164701 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
-
Russ Cox authored
Standard output is reserved for actual program output. Debug print should be limited in general (here they are enabled by an environment variable) and always go to standard error. Came across by accident. Change-Id: I1490be71473520f049719572b3acaa0ea9f9e5c1 Reviewed-on: https://go-review.googlesource.com/c/go/+/167502 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
-
Robert Griesemer authored
Per discussion on #30769. Fixes #30769. Change-Id: I620dbac936de1a0b5deec03926dd11d690a918e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/167380Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Rob Pike <r@golang.org>
-
Josh Bleecher Snyder authored
As of CL 163747, we can write arbitrary length strings in assembly DATA instructions. Make use of it here to improve readability. Change-Id: I556279ca893f527874e3b26112c43573834ccd9c Reviewed-on: https://go-review.googlesource.com/c/go/+/167386 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Russ Cox authored
CL 165619 removed these names when it removed the use of the plain 'return'. But the names help for documentation purposes even without being mentioned directly in the function, so removing them makes the code less readable. Put them back. I renamed found to zeroFound to make the meaning clearer. Change-Id: I1010931f08290af0b0ede7d21b1404c2eea196a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/165899 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Josh Bleecher Snyder authored
This rewrite rule triggers only once, in math/big.quotToFloat64, as part of converting a uint64 to a float64. Nevertheless, it is cheap; let's add it. Change-Id: I3ed4a197a559110fec1bc04b3a8abb4c7fcc2c89 Reviewed-on: https://go-review.googlesource.com/c/go/+/167500 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Josh Bleecher Snyder authored
We know that a & 31 is non-negative for all a, signed or not. We can avoid checking that and needing to write out an unreachable call to panicshift. Change-Id: I32f32fb2c950d2b2b35ac5c0e99b7b2dbd47f917 Reviewed-on: https://go-review.googlesource.com/c/go/+/167499 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Keith Randall <khr@golang.org>
-
- 13 Mar, 2019 17 commits
-
-
Matthew Dempsky authored
Based on suggestion from gri@ on golang.org/cl/166980. Passes toolstash-check. Change-Id: I79b66bb09b5635f3a9daecaa5d605b661a0ab108 Reviewed-on: https://go-review.googlesource.com/c/go/+/167501 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
Change-Id: I33f5b5051e5f75aa264ec656926223c5a3c09c1b Reviewed-on: https://go-review.googlesource.com/c/go/+/167498 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matt Layher <mdlayher@gmail.com>
-
Bryan C. Mills authored
Fixes #30758 Change-Id: I8e49958602de9caa47bb5710828158e51744f375 Reviewed-on: https://go-review.googlesource.com/c/go/+/167478 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Daniel Martí authored
The len godoc uses a blockquote to list the rules for its semantics. The item that describes channels is a bit long, so it's split in two lines. However, the first line ends with a semicolon, and the second line can be read as a sentence of its own, so it's easy to misinterpret that the two lines are separate. Making that easy mistake would lead to an incorrect understanding of len: if v is nil, len(v) is zero. This could lead us to think that len(nil) is valid and should return zero. When in fact, that statement only applies to nil channels. To make this less ambiguous, add a bit of indentation to the follow-up line, to align with the channel body. If lists are added to godoc in the future via #7873, perhaps this text can be simplified. Fixes #30349. Change-Id: I84226edc812d429493137bcc65c332e92d4e6c87 Reviewed-on: https://go-review.googlesource.com/c/go/+/167403 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Somebody wasn't using goimports. :) Change-Id: Ibad3c0781ea70d538592b2e90d8b578e4fae8173 Reviewed-on: https://go-review.googlesource.com/c/go/+/167385Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Hana Kim authored
`go build` has chosen the last element of the package import path as the default output name when -o option is given. That caused the output of a package build when the module root is the major version component such as 'v2'. A similar issue involving `go install` was fixed in https://golang.org/cl/128900. This CL refactors the logic added with the change and makes it available as internal/load.DefaultExecName. This CL makes 'go test' to choose the right default test binary name when the tested package is in the module root. (E.g., instead of v2.test, choose pkg.test for the test of 'path/pkg/v2') Fixes #27283. Change-Id: I6905754f0906db46e3ce069552715f45356913ae Reviewed-on: https://go-review.googlesource.com/c/go/+/140863Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Matthew Dempsky authored
Change-Id: Ib55f2458c75aee49302f0dd4e2a819f9931a5ed3 Reviewed-on: https://go-review.googlesource.com/c/go/+/166982 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Matthew Dempsky authored
The only ways to construct an OLITERAL node are (1) a basic literal from the source package, (2) constant folding within evconst (which only folds Go language constants), (3) the universal "nil" constant, and (4) implicit conversions of nil to some concrete type. Passes toolstash-check. Change-Id: I30fc6b07ebede7adbdfa4ed562436cbb7078a2ff Reviewed-on: https://go-review.googlesource.com/c/go/+/166981 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Matthew Dempsky authored
All setconst calls now happen within evconst. While here, get rid of callrecv, which (incompletely) duplicates the logic of hascallchan. Passes toolstash-check. Change-Id: Ic67b9dd2a1b397d4bc25e8c8b6f81daf4f6cfb75 Reviewed-on: https://go-review.googlesource.com/c/go/+/166980 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Ilya Tocar authored
We already have a pure go code sequence that is compiled into single load. Just use it everywhere, instead of pointer hackery. Passes toolstash-check. Change-Id: I0c42b5532fa9a5665da3385913609c6d42aaff27 Reviewed-on: https://go-review.googlesource.com/c/go/+/118568 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
-
Clément Chigot authored
Change-Id: Ib98c7ad91d83ce68811f5c671200462c5fee0fca Reviewed-on: https://go-review.googlesource.com/c/go/+/167398 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
-
Michael Munday authored
This reduces the number of extra bounds check hints we need to insert. For example, rather than producing: _ = v.Args[2] x := v.Args[0] y := v.Args[1] z := v.Args[2] We now produce: z := v.Args[2] x := v.Args[0] y := v.Args[1] This gets rid of about 7000 lines of code from the rewrite rules. Change-Id: I1291cf0f82e8d035a6d65bce7dee6cedee04cbcd Reviewed-on: https://go-review.googlesource.com/c/go/+/167397Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Bryan C. Mills authored
Change-Id: I0223d935184017e841d56abe114d78b670457c5a Reviewed-on: https://go-review.googlesource.com/c/go/+/167437 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Carlos Eduardo Seo authored
ppc64{,le} processor level selection allows the compiler to generate instructions targeting newer processors and processor-specific optimizations without breaking compatibility with our current baseline. This feature introduces a new environment variable, GOPPC64. GOPPC64 is a GOARCH=ppc64{,le} specific option, for a choice between different processor levels (i.e. Instruction Set Architecture versions) for which the compiler will target. The default is 'power8'. Change-Id: Ic152e283ae1c47084ece4346fa002a3eabb3bb9e Reviewed-on: https://go-review.googlesource.com/c/go/+/163758 Run-TryBot: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
David Chase authored
When a jump at the end of a block is about to be marked as a statement, if the first real instruction in the target block is also a statement for the same line, remove the mark from the jump. This is a first effort at a minimal-harm heuristic. A better heuristic might skip over any "not-statement" values preceding a definitely marked value. Fixes #29443. Change-Id: Ibd52783713b4936e0c2dfda8d708bf186f33b00a Reviewed-on: https://go-review.googlesource.com/c/go/+/159977 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Bryan C. Mills authored
Fixes #30571 Change-Id: Id4c74e83ee58a080d1c2894ae5ebdbf4aeb1ce42 Reviewed-on: https://go-review.googlesource.com/c/go/+/167084 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Daniel Martí authored
This internally exported function allowed merging environment variable lists, and was mostly a convenience for the rest of cmd/go/internal. It seems to date all the way back to 2013. However, since CL 37586 in early 2017, os/exec has already taken care of deduplicating environment variable lists. Thus, it's unnecessary for cmd/go to take care of that before calling exec.Cmd.Start. Moreover, because os/exec will deduplicate the list in any case, we're adding extra work in all these scenarios. Finally, remove an unnecessary addition of GOROOT= in internal/tool. cfg.OrigEnv may not have the correct GOROOT set up, but os.Environ does; cmd/go's main function makes sure of that. Change-Id: I1f92f65fb927dc15bc7b0397cfd1a572b6337bb3 Reviewed-on: https://go-review.googlesource.com/c/go/+/164703 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-