- 18 Mar, 2016 9 commits
-
-
Todd Neal authored
Phi splitting sometimes leads to a phi with only a single predecessor. This must be replaced with a copy to maintain a valid SSA form. Fixes #14857 Change-Id: I5ab2423fb6c85a061928e3206b02185ea8c79cd7 Reviewed-on: https://go-review.googlesource.com/20826Reviewed-by: Keith Randall <khr@golang.org>
-
Marcel van Lohuizen authored
API not exposed yet. Change-Id: Iaba0adc0fa1ae8075e6b56796f99ee8db9177a78 Reviewed-on: https://go-review.googlesource.com/18896Reviewed-by: Russ Cox <rsc@golang.org>
-
Marcel van Lohuizen authored
API is not exposed yet. Change-Id: I729360ef2be1d8ea683ca93cdb1763897cc8657c Reviewed-on: https://go-review.googlesource.com/18895Reviewed-by: Russ Cox <rsc@golang.org>
-
Marcel van Lohuizen authored
testing.go: - run method will evolve into the Run method. - added level field in common benchmark.go: - benchContext will be central to distinguish handling of benchmarks between normal Run methods and ones called from within Benchmark function. - expandCPU will evolve into the processing hook for Run methods called within normal processing. - runBench will evolve into the Run method. Change-Id: I1816f9985d5ba94deb0ad062302ea9aee0bb5338 Reviewed-on: https://go-review.googlesource.com/18894Reviewed-by: Russ Cox <rsc@golang.org>
-
Marcel van Lohuizen authored
The biggest change is that each test is now responsible for managing the starting and stopping of its parallel subtests. The "Main" test could be run as a tRunner as well. This shows that the introduction of subtests is merely a generalization of and consistent with the current semantics. Change-Id: Ibf8388c08f85d4b2c0df69c069326762ed36a72e Reviewed-on: https://go-review.googlesource.com/18893Reviewed-by: Russ Cox <rsc@golang.org>
-
David Symonds authored
There's nothing guaranteeing that the *Regexp isn't in active use, and so copying the sync.Mutex value is invalid. Updates #14839. Change-Id: Iddf52bf69df1b563377922399f64a571f76b95dd Reviewed-on: https://go-review.googlesource.com/20841Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
-
David Chase authored
This seems to help the problem reported in #14606; this change seems to produce about a 4% improvement (mostly for the 128-8192 shards). Fixes #14789. Change-Id: I1bd52c82d4ca81d9d5e9ab371fdfc860d7e8af50 Reviewed-on: https://go-review.googlesource.com/20660 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Christopher Nelson authored
Improve the test by also translating " " to "_". Fixes #14671. Change-Id: Ie5997934b93c7663d7b8432244fad47bb5d3ffbe Reviewed-on: https://go-review.googlesource.com/20714Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
David Chase authored
This is intended to help debug compiler problems that pop up in the bootstrap phase of make.bash. GO_GCFLAGS does not normally apply there. Options-for-all phases is intended to allow crude tracing (and full timing) by turning on timing for all phases, not just one. Phase names can also be specified using a regular expression, for example BOOT_GO_GCFLAGS=-d='ssa/~^.*scc$/off' \ GO_GCFLAGS='-d=ssa/~^.*scc$/off' ./make.bash I just added this because it was the fastest way to get me to a place where I could easily debug the compiler. Change-Id: I0781f3e7c19651ae7452fa25c2d54c9a245ef62d Reviewed-on: https://go-review.googlesource.com/20775Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 17 Mar, 2016 24 commits
-
-
Todd Neal authored
Change-Id: Ic40449b2e4b4f18cbe5b5d4c3d51ea7b05ac674d Reviewed-on: https://go-review.googlesource.com/20823 Run-TryBot: Todd Neal <todd@tneal.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Mikio Hara authored
This change makes unexposed methods start with lowercase letters for avoiding unnecessary confusion because the net package uses many embedding structures and intrefaces for controlling exposure of APIs. Note that this change leaves DNS-related methods as they are. Change-Id: I253758d1659175c5d0af6b2efcd30ce83f46543d Reviewed-on: https://go-review.googlesource.com/20784 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Hyang-Ah Hana Kim authored
Change-Id: Ic5f62a7d0a5c090da69213d1d0187af0ea48e358 Reviewed-on: https://go-review.googlesource.com/20820Reviewed-by: Rob Pike <r@golang.org>
-
David Chase authored
The critical phase did not correctly maintain the use count when two predecessors of a new critical block transmit the same value. Change-Id: Iba802c98ebb84e36a410721ec32c867140efb6d4 Reviewed-on: https://go-review.googlesource.com/20822Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Todd Neal <todd@tneal.org>
-
Alexandru Moșoi authored
* This the simplest solution I could came up with that doesn't required changing the compiler. * The bound checks become constants now so they are removed during opt phase. Updates #14808 Change-Id: If32c33d7ec08bb400321b465015d152f0a5d3001 Reviewed-on: https://go-review.googlesource.com/20654Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Change-Id: I3c6035559288cfdc33857216f50241b81932c8a4 Reviewed-on: https://go-review.googlesource.com/20811 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Keith Randall authored
Make sure we don't generate write barriers in runtime code that is marked to forbid write barriers. Implement the optimization that if we're writing a sliced slice back to the location it came from, we don't need a write barrier. Fixes #14784 Change-Id: I04b6a3b2ac303c19817e932a36a3b006de103aaa Reviewed-on: https://go-review.googlesource.com/20791Reviewed-by: Austin Clements <austin@google.com>
-
Shahar Kohanim authored
Reduces size of archives in pkg/linux_amd64 by 1.4MB (3.2%), slightly improving link time. name old s/op new s/op delta LinkCmdGo 0.52 ± 3% 0.51 ± 2% -0.65% (p=0.000 n=98+99) Change-Id: I7e265f4d4dd08967c5c5d55c1045e533466bbbec Reviewed-on: https://go-review.googlesource.com/20802 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ingo Oeser authored
Change-Id: I32fd5c36f055fdb1dfe56524085676aa4111089a Reviewed-on: https://go-review.googlesource.com/20830Reviewed-by: David Chase <drchase@google.com>
-
Matthew Dempsky authored
Boolean expressions involving t.Thistuple were converted to use t.Recv(), because it's a bit clearer and will hopefully reveal cases where we could remove redundant calls to t.Recv() (in followup CLs). The other cases were all converted to use t.Recvs().NumFields(), t.Params().NumFields(), or t.Results().NumFields(). Change-Id: I4df91762e7dc4b2ddae35995f8dd604a52c09b09 Reviewed-on: https://go-review.googlesource.com/20796Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com>
-
Matthew Dempsky authored
We never need a type hash for a method type, so skip trying to overwrite Thistuple. Change-Id: I8de6480ba5fd321dfa134facf7661461d298840e Reviewed-on: https://go-review.googlesource.com/20795Reviewed-by: Russ Cox <rsc@golang.org>
-
Matthew Dempsky authored
This is an automated rewrite of all the calls of the form: for f, it := IterFields(t); f != nil; f = it.Next() { ... } Followup CLs will work on cleaning up the remaining cases. Change-Id: Ic1005ad45ae0b50c63e815e34e507e2d2644ba1a Reviewed-on: https://go-review.googlesource.com/20794Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Matthew Dempsky authored
Analogous to the Nodes type used as a more space efficient []*Node representation. Passes toolstash -cmp. Change-Id: I8341e45304777d6e4200bd36dadc935b07ccf3ff Reviewed-on: https://go-review.googlesource.com/20793Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Austin Clements authored
Change-Id: I85c0bcf02842cc32dbc9bfdcea27efe871173574 Reviewed-on: https://go-review.googlesource.com/20774Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Matthew Dempsky authored
The compiler doesn't care about the runtime's sudog type. Stop constructing it. Change-Id: If1885fe30b2e215a08d17662eab5ea6d81fe58ab Reviewed-on: https://go-review.googlesource.com/20797 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Austin Clements <austin@google.com>
-
Ian Lance Taylor authored
For every string constant the compiler was creating 2 Sym's and 2 Node's. It would never refer to them again, but would keep them alive in gostringpkg. This changes the code to just use obj.LSym's instead. When compiling x/tools/go/types, this yields about a 15% reduction in the number of calls to newname and a 3% reduction in the total number of Node objects. Unfortunately I couldn't see any change in compile time, but reducing memory usage is desirable anyhow. Passes toolstash -cmp. Change-Id: I24f1cb1e6cff0a3afba4ca66f7166874917a036b Reviewed-on: https://go-review.googlesource.com/20792Reviewed-by: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
David Chase authored
This should probably be considered "experimental" at this stage, but what it needs is feedback from adventurous adopters. I think the data structure used for describing escape reasons might be extendable to allow a cleanup of the underlying algorithms, which suffers from insufficiently separated concerns (the graph does not deal well with escape level adjustments, so it is augmented by a second custom-walk portion of the "flood" phase. It would be better to put it all, including level adjustments, in a single graph structure, and then simply flood the graph. Tweaked to avoid allocations in the no-logging case. Modified run.go to ignore lines with leading "#" in the output (since it can never match a line), and in -update_errors to ignore leading tabs in output lines and to normalize embedded filenames. Currently requires -m -m because otherwise the noise/update burden for the other escape tests is considerable. There is a partial test. Existing escape analysis tests seem to cover all except the panic case and what looks like it might be unreachable code in escape analysis. Fixes #10526. Change-Id: I2524fdec54facae48b00b2548e25d9e46fcaf832 Reviewed-on: https://go-review.googlesource.com/18041 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Todd Neal authored
If a phi has duplicate arguments, then the new block that is constructed to remove the critical edge can be used for all of the duplicate arguments. read-only data = -904 bytes (-0.058308%) global text (code) = -2240 bytes (-0.060056%) Total difference -3144 bytes (-0.056218%) Change-Id: Iee3762744d6a8c9d26cdfa880bb23feb62b03c9c Reviewed-on: https://go-review.googlesource.com/20746 Run-TryBot: Todd Neal <todd@tneal.org> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Richard Miller authored
Between the enumeration of fdsToClose in the parent and the closing of fds in the child, it's possible for a file to be closed in another thread. If that file descriptor is reused when opening the child-parent status pipe, it will be closed prematurely in the child and the forkExec gets out of sync. This has been observed to cause failures in builder tests when the link step of a build is started before the compile step has run, with "file does not exist" messages as the visible symptom. The simple workaround is to check against closing the pipe. A more comprehensive solution would be to rewrite the fd closing code to avoid races, along the lines of the long ago proposed https://golang.org/cl/57890043 - but meanwhile this correction will prevent some builder failures. Change-Id: I4ef5eaea70c21d00f4df0e0847a1c5b2966de7da Reviewed-on: https://go-review.googlesource.com/20800 Run-TryBot: David du Colombier <0intro@gmail.com> Reviewed-by: David du Colombier <0intro@gmail.com>
-
Martin Möhrmann authored
Separate unicode formatting into its own fmt_unicode function. Remove the fmtUnicode wrapper and the f.unicode and f.uniQuote flags that are not needed anymore. Remove mangling and restoring of the precision and sharp flags. Removes the buffer copy needed for %#U by moving the character encoding before the number encoding. Changes the behavior of plus and space flag to have no effect instead of printing a plus or space before "U+". Always print at least four digits after "U+" even if precision is set to less than 4. Change-Id: If9a0ee79e9eca2c76f06a4e0fdd75d98393899ac Reviewed-on: https://go-review.googlesource.com/20574 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Keith Randall authored
Keep track of how many uses each Value has. Each appearance in Value.Args and in Block.Control counts once. The number of uses of a value is generically useful to constrain rewrite rules. For instance, we might want to prevent merging index operations into loads if the same index expression is used lots of times. But I have one use in particular for which the use count is required. We must make sure we don't combine ops with loads if the load has more than one use. Otherwise, we may split a single load into multiple loads and that breaks perceived behavior in the presence of races. In particular, the load of m.state in sync/mutex.go:Lock can't be done twice. (I have a separate CL which triggers the mutex failure. This CL has a test which demonstrates a similar failure.) Change-Id: Icaafa479239f48632a069d0c3f624e6ebc6b1f0e Reviewed-on: https://go-review.googlesource.com/20790 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Todd Neal <todd@tneal.org>
-
Dave Cheney authored
Spotted while splunking in the compiler with GOGC=off. name old time/op new time/op delta Template 407ms ± 5% 402ms ± 6% ~ (p=0.301 n=20+20) GoTypes 1.33s ± 2% 1.29s ± 1% -3.47% (p=0.000 n=20+20) Compiler 6.21s ± 1% 5.91s ± 2% -4.83% (p=0.000 n=20+20) name old alloc/op new alloc/op delta Template 66.8MB ± 0% 63.9MB ± 0% -4.46% (p=0.000 n=19+20) GoTypes 232MB ± 0% 220MB ± 0% -5.16% (p=0.000 n=19+17) Compiler 1.02GB ± 0% 0.97GB ± 0% -5.81% (p=0.000 n=20+20) name old allocs/op new allocs/op delta Template 789k ± 0% 708k ± 0% -10.28% (p=0.000 n=19+20) GoTypes 2.49M ± 0% 2.20M ± 0% -11.57% (p=0.000 n=20+20) Compiler 10.8M ± 0% 9.4M ± 0% -12.82% (p=0.000 n=20+20) Change-Id: I76615cab912dde10595ca6ab9979ff6c5f1aec49 Reviewed-on: https://go-review.googlesource.com/20782Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Michael Hudson-Doyle authored
When building shared libraries, all symbols on Allsym are marked reachable. What I didn't realize was that this includes the ".dup" symbols created when "dupok" symbols are read from multiple package files. This breaks now because deadcode makes some assumptions that fail for these ".dup" symbols, but in any case was a bad idea -- I suspect this change makes libstd.so a bunch smaller, but creating it was broken before this CL so I can't be sure. This change simply stops adding these symbols to Allsym, which might make some of the many iterations over Allsym the linker does a touch quicker, although that's not the motivation here. Add a test that no symbols called ".dup" makes it into the runtime shared library. Fixes #14841 Change-Id: I65dd6e88d150a770db2d01b75cfe5db5fd4f8d25 Reviewed-on: https://go-review.googlesource.com/20780 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Receiver parameters generally aren't relevant to the function signature type. In particular: 1. When checking whether a type's method implements an interface's method, we specifically want to ignore the receiver parameters, because they'll be different. 2. When checking interface type equality, interface methods always use the same "fakethis" *struct{} type as their receiver. 3. Finally, method expressions and method values degenerate into receiver-less function types. The only case where we care about receiver types matching is in addmethod, which is easily handled by adding an extra Eqtype check of the receiver parameters. Also, added a test for this, since (surprisingly) there weren't any. As precedence, go/types.Identical ignores receiver parameters when comparing go/types.Signature values. Notably, this allows us to slightly simplify the "implements" function, which is used for checking whether type/interface t implements interface iface. Currently, cmd/compile actually works around Eqtype's receiver parameter checking by creating new throwaway TFUNC Types without the receiver parameter. (Worse, the compiler currently only provides APIs to build TFUNC Types from Nod syntax trees, so building those throwaway types also involves first building throwaway syntax trees.) Passes toolstash -cmp. Change-Id: Ib07289c66feacee284e016bc312e8c5ff674714f Reviewed-on: https://go-review.googlesource.com/20602Reviewed-by: Robert Griesemer <gri@golang.org>
-
- 16 Mar, 2016 7 commits
-
-
Josh Bleecher Snyder authored
Follow-up to CL 20674. Passes toolstash -cmp. Change-Id: I065fd4cd80d996c1e6566773189401ca4630c1ca Reviewed-on: https://go-review.googlesource.com/20692 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dave Cheney <dave@cheney.net>
-
Josh Bleecher Snyder authored
We can’t perfectly predict how large the function will be, but we can make a safe overestimate. No significant CPU time changes. name old alloc/op new alloc/op delta Template 67.7MB ± 0% 67.5MB ± 0% -0.24% (p=0.029 n=4+4) Unicode 43.9MB ± 0% 43.8MB ± 0% -0.13% (p=0.029 n=4+4) GoTypes 244MB ± 0% 244MB ± 0% -0.28% (p=0.029 n=4+4) Compiler 1.05GB ± 0% 1.05GB ± 0% -0.38% (p=0.029 n=4+4) name old allocs/op new allocs/op delta Template 795k ± 0% 794k ± 0% -0.14% (p=0.029 n=4+4) Unicode 569k ± 0% 569k ± 0% ~ (p=0.114 n=4+4) GoTypes 2.59M ± 0% 2.58M ± 0% -0.11% (p=0.029 n=4+4) Compiler 11.0M ± 0% 11.0M ± 0% -0.09% (p=0.029 n=4+4) Passes toolstash -cmp. Change-Id: I0a92ab04cba7520540ec58fe7189666d0e771454 Reviewed-on: https://go-review.googlesource.com/20771Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
-
Josh Bleecher Snyder authored
Passes toolstash -cmp. Change-Id: I77a415a4e5d8de7eb902fb0866aaf8783259485a Reviewed-on: https://go-review.googlesource.com/20770Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
James Bardin authored
Add a C.CBytes function to copy a Go byte slice into C memory. This returns an unsafe.Pointer, since that is what needs to be passed to C.free, and the data is often opaque bytes anyway. Fixes #14838 Change-Id: Ic7bc29637eb6f1f5ee409b3898c702a59833a85a Reviewed-on: https://go-review.googlesource.com/20762Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Austin Clements authored
Currently we generate write barriers when the right side of an assignment is a global function. This doesn't fall into the existing case of storing an address of a global because we haven't lowered the function to a pointer yet. This write barrier is unnecessary, so eliminate it. Fixes #13901. Change-Id: Ibc10e00a8803db0fd75224b66ab94c3737842a79 Reviewed-on: https://go-review.googlesource.com/20772 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Keith Randall <khr@golang.org>
-
Josh Bleecher Snyder authored
Passes toolstash -cmp. Change-Id: Ie11912a16d2cd54500e2f6e84316519b80e7c304 Reviewed-on: https://go-review.googlesource.com/20672Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
c2go translated writing and advancing a pointer using slices. Switch to something more idiomatic. It is also more efficient, but not enough to matter. Change-Id: I67709632ac53253615a35365824ae97bbe5458d5 Reviewed-on: https://go-review.googlesource.com/20767 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-