- 01 Mar, 2016 17 commits
-
-
Keith Randall authored
Merge dev.ssa branch back into master. Change-Id: Ie6fac3f8d355ab164f934415fe4fc7fcb8c3db16
-
David Chase authored
Static branch predictions (which guide block ordering) are adjusted based on: loop/not-loop (favor looping) abnormal-exit/not (avoid panic) call/not-call (avoid call) ret/default (treat returns as rare) This appears to make no difference in performance of real code, meaning the compiler itself. The earlier version of this has been stripped down to help make the cost of this only-aesthetic-on-Intel phase be as cheap as possible (we probably want information about inner loops for improving register allocation, but because register allocation follows close behind this pass, conceivably the information could be reused -- so we might do this anyway just to normalize output). For a ./make.bash that takes 200 user seconds, about .75 second is reported in likelyadjust (summing nanoseconds reported with -d=ssa/likelyadjust/time ). Upstream predictions are respected. Includes test, limited to build on amd64 only. Did several iterations on the debugging output to allow some rough checks on behavior. Debug=1 logging notes agree/disagree with earlier passes, allowing analysis like the following: Run on make.bash: GO_GCFLAGS=-d=ssa/likelyadjust/debug \ ./make.bash >& lkly5.log grep 'ranch prediction' lkly5.log | wc -l 78242 // 78k predictions grep 'ranch predi' lkly5.log | egrep -v 'agrees with' | wc -l 29633 // 29k NEW predictions grep 'disagrees' lkly5.log | wc -l 444 // contradicted 444 times grep '< exit' lkly5.log | wc -l 10212 // 10k exit predictions grep '< exit' lkly5.log | egrep 'disagrees' | wc -l 5 // 5 contradicted by previous prediction grep '< exit' lkly5.log | egrep -v 'agrees' | wc -l 702 // 702-5 redundant with previous prediction grep '< call' lkly5.log | egrep -v 'agrees' | wc -l 16699 // 16k new call predictions grep 'stay in loop' lkly5.log | egrep -v 'agrees' | wc -l 3951 // 4k new "remain in loop" predictions Fixes #11451. Change-Id: Iafb0504f7030d304ef4b6dc1aba9a5789151a593 Reviewed-on: https://go-review.googlesource.com/19995 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org>
-
Matthew Dempsky authored
Add a blank line before the "package ssa" lines so the "autogenerated don't edit" comments don't end up in godoc output. Change-Id: I82bf90d52d426ce1a8e21483fc8f47b3689259c7 Reviewed-on: https://go-review.googlesource.com/20086Reviewed-by: Keith Randall <khr@golang.org>
-
David Crawshaw authored
Change-Id: I1ece7463d35efba0e8d2b1e61727dd25283ff720 Reviewed-on: https://go-review.googlesource.com/20059Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Alexandru Moșoi authored
* Decreases the generated code slightly. * Similar to phiopt pass from gcc, except it only handles booleans. Handling Eq/Neq had no impact on the generated code. name old time/op new time/op delta Template 453ms ± 4% 451ms ± 4% ~ (p=0.468 n=24+24) GoTypes 1.55s ± 1% 1.55s ± 2% ~ (p=0.287 n=24+25) Compiler 6.53s ± 2% 6.56s ± 1% +0.46% (p=0.050 n=23+23) MakeBash 45.8s ± 2% 45.7s ± 2% ~ (p=0.866 n=24+25) name old text-bytes new text-bytes delta HelloSize 676k ± 0% 676k ± 0% ~ (all samples are equal) CmdGoSize 8.07M ± 0% 8.07M ± 0% -0.03% (p=0.000 n=25+25) Change-Id: Ia62477b7554127958a14cb27f85849b095d63663 Reviewed-on: https://go-review.googlesource.com/20090Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Alexandru Moșoi authored
* This is a very basic form of straight line strength reduction. * Removes one multiplication from a[b].c++; a[b+1].c++ * It increases pressure on the register allocator because CSE creates more copies of the multiplication sizeof(a[0])*b. Change-Id: I686a18e9c24cc6f8bdfa925713afed034f7d36d0 Reviewed-on: https://go-review.googlesource.com/20091 Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Ilya Tocar authored
Writing to low 8/16 bits of register creates false dependency Generate 32-bit operations when possible. Change-Id: I8eb6c1c43a66424eec6baa91a660bceb6b80d1d3 Reviewed-on: https://go-review.googlesource.com/19506Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Change-Id: I5546c4e8092ef61648cdae9c04288bb7d6f32476 Reviewed-on: https://go-review.googlesource.com/20084 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Martin Möhrmann authored
Use only reflect.TypeOf to detect if argument is a string. The wasString return is only needed in doPrint with the 'v' verb. This type of string detection is handled correctly by reflect.TypeOf which is used already in doPrint for identifying a string argument. Remove now obsolete wasString computations and return values. Change-Id: Iea2de7ac0f5c536a53eec63f7e679d628f5af8dc Reviewed-on: https://go-review.googlesource.com/19976 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Matthew Dempsky authored
Updates #13940. Change-Id: I41974c292dd981d82ac03b9b8b406713445362c3 Reviewed-on: https://go-review.googlesource.com/20081 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Matthew Dempsky authored
Change-Id: I99c737415a082df883a9c12cdb43bdd5a1b9a8ad Reviewed-on: https://go-review.googlesource.com/20082Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Matthew Dempsky authored
Also, relocate related const and type definitions from go.go. Change-Id: Ieb9b672da8dd510ca67022b4f7ae49a778a56579 Reviewed-on: https://go-review.googlesource.com/20080 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Dave Cheney <dave@cheney.net> Reviewed-by: Keith Randall <khr@golang.org>
-
Matthew Dempsky authored
Change-Id: I2d8efef333f2441da6742e125e23ff57c9853ebd Reviewed-on: https://go-review.googlesource.com/20078 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dave Cheney <dave@cheney.net>
-
Matthew Dempsky authored
Change-Id: I42f370b987fcc85201f7aaa055b9e58ee9b9a99e Reviewed-on: https://go-review.googlesource.com/20079 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
nwidger authored
Fixes #14371 Change-Id: I8e9e4b2b89083f5a947e791c011912fdf365a11e Reviewed-on: https://go-review.googlesource.com/19996Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Keith Randall authored
Add writeback code to each return location which copies the final result back to the correct stack location. Cgo plays tricky games by taking the address of a in f(a int) (b int) and then using that address to modify b. So for cgo-generated Go code, disable the SSAing of output args. Update #14511 Change-Id: I95cba727d53699d31124eef41db0e03935862be9 Reviewed-on: https://go-review.googlesource.com/19988Reviewed-by: Todd Neal <todd@tneal.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
Fixes #14570. Change-Id: Ief84a14585bfc209e38cdf15702c2f54ba759714 Reviewed-on: https://go-review.googlesource.com/20057 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
-
- 29 Feb, 2016 22 commits
-
-
Shahar Kohanim authored
In best of 10, linking cmd/go shows a ~10% improvement. tip: real 0m1.152s user 0m1.005s this: real 0m1.065s user 0m0.924s Change-Id: I303a20b94332feaedc1033c453247a0e4c05c843 Reviewed-on: https://go-review.googlesource.com/19978Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Gerrit Code Review authored
-
Josh Bleecher Snyder authored
The cache gets a 62% hit rate while compiling the standard library. name old time/op new time/op delta Template 449ms ± 2% 443ms ± 4% -1.40% (p=0.006 n=23+25) GoTypes 1.54s ± 1% 1.50s ± 2% -2.53% (p=0.000 n=22+22) Compiler 5.51s ± 1% 5.39s ± 1% -2.29% (p=0.000 n=23+25) name old alloc/op new alloc/op delta Template 90.4MB ± 0% 90.0MB ± 0% -0.45% (p=0.000 n=25+25) GoTypes 334MB ± 0% 331MB ± 0% -1.05% (p=0.000 n=25+25) Compiler 1.12GB ± 0% 1.10GB ± 0% -1.57% (p=0.000 n=25+24) name old allocs/op new allocs/op delta Template 681k ± 0% 682k ± 0% +0.26% (p=0.000 n=25+25) GoTypes 2.23M ± 0% 2.23M ± 0% +0.05% (p=0.000 n=23+24) Compiler 6.46M ± 0% 6.46M ± 0% +0.02% (p=0.000 n=24+25) Change-Id: I2629c291892827493d7b55ec4d83f6973a2ab133 Reviewed-on: https://go-review.googlesource.com/20026Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Keith Randall authored
(Last?) Semi-regular merge from tip to dev.ssa. Conflicts: src/cmd/compile/internal/gc/closure.go src/cmd/compile/internal/gc/gsubr.go src/cmd/compile/internal/gc/lex.go src/cmd/compile/internal/gc/pgen.go src/cmd/compile/internal/gc/syntax.go src/cmd/compile/internal/gc/walk.go src/cmd/internal/obj/pass.go Change-Id: Ib5ea8bf74d420f4902a9c6208761be9f22371ae7
-
Keith Randall authored
It gets rewritten to an xor by the linker also. Change-Id: Iae35130325d41bd1a09b7e971190cae6f4e17fac Reviewed-on: https://go-review.googlesource.com/20058Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
David Crawshaw authored
The object file reader in cmd/link reads the symbol name into a scratch []byte, converts it to a string, and then does a substring replacement. Instead, this CL does the replacement on the []byte into the scratch space and then creates the final string. Linking godoc without DWARF, best of ten, shows a ~10% improvement. tip: real 0m1.099s user 0m1.541s this: real 0m0.990s user 0m1.280s This is part of an attempt to make suffixarray string deduping come out as a wash, but it's not there yet: cl/19987: real 0m1.335s user 0m1.794s cl/19987+this: real 0m1.225s user 0m1.540s Change-Id: Idf061fdfbd7f08aa3a1f5933d3f111fdd1659210 Reviewed-on: https://go-review.googlesource.com/20025Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
David Crawshaw authored
The Cpos function is used frequently (at least once per symbol) and it is implemented with the seek syscall. Instead, track current output offset and use it. Building the godoc binary with DWARF, best of ten: tip: real 0m1.287s user 0m1.573s this: real 0m1.208s user 0m1.555s Change-Id: I068148695cd6b4d32cd145db25e59e6f6bae6945 Reviewed-on: https://go-review.googlesource.com/20055 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Robert Griesemer authored
Change-Id: Ib0dd458d4ab1c58a2baf36491e288ac32e2ff99e Reviewed-on: https://go-review.googlesource.com/19962Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
David Crawshaw authored
Reduces number of memory allocations by 12%: Before: 1816664 After: 1581591 Small speed improvement. Change-Id: I61281fb852e8e31851a350e3ae756676705024a4 Reviewed-on: https://go-review.googlesource.com/20027Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
Update #14559. Change-Id: I92603602e5d0a5fcae43f3084f234ff606447190 Reviewed-on: https://go-review.googlesource.com/20056 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Shahar Kohanim authored
Reduces best of 10 linking of cmd/go by ~5% Change-Id: If673b877ee12595dae517d7eb48430451e5cadba Reviewed-on: https://go-review.googlesource.com/20060Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Shahar Kohanim authored
Preallocate ~2MB for Lsym map (size calculation from http://play.golang.org/p/9L7F5naXRr). Reduces best of 10 link time of cmd/go by ~4%. On cmd/go max resident size unaffected, on println hello world max resident size grows by 4mb from 18mb->22mb. Performance improves in both cases. tip: real 0m1.283s user 0m1.502s sys 0m0.144s this: real 0m1.341s user 0m1.598s sys 0m0.136s Change-Id: I4a95e45fe552f1f64f53e868421b9f45a34f8b96 Reviewed-on: https://go-review.googlesource.com/19979 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Benoit Sigoure authored
In golang.org/cl/14449 the `getdents' system call got changed to use _SYS_getdents as a layer of indirection instead of SYS_GETDENTS64 for compatibility with mips64, but this broke mksyscall.pl, which then died with with: syscall_linux.go:840: malformed //sys declaration Change-Id: Icb61965d8730f6e81f9fb0fa28c7bab635470f09 Reviewed-on: https://go-review.googlesource.com/20051Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
Update #14559. Change-Id: I8894f8e16902685f55a21d902199fbe0905f0558 Reviewed-on: https://go-review.googlesource.com/20050 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
-
Ilya Tocar authored
This is a AMD64 version of CL19743. Saves additional 1574 bytes in go binary. This also speeds up bzip2 by 1-4% Change-Id: I031ba423663c4e83fdefe44e5296f24143e303da Reviewed-on: https://go-review.googlesource.com/19939 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Ilya Tocar authored
Movups is 1 byte smaller than movapd that we currently use. Change-Id: I22f771f066529352722a28543535ec43497cb9c5 Reviewed-on: https://go-review.googlesource.com/19938Reviewed-by: David Chase <drchase@google.com>
-
Brad Fitzpatrick authored
Named returned values should only be used on public funcs and methods when it contributes to the documentation. Named return values should not be used if they're only saving the programmer a few lines of code inside the body of the function, especially if that means there's stutter in the documentation or it was only there so the programmer could use a naked return statement. (Naked returns should not be used except in very small functions) This change is a manual audit & cleanup of public func signatures. Signatures were not changed if: * the func was private (wouldn't be in public godoc) * the documentation referenced it * the named return value was an interesting name. (i.e. it wasn't simply stutter, repeating the name of the type) There should be no changes in behavior. (At least: none intended) Change-Id: I3472ef49619678fe786e5e0994bdf2d9de76d109 Reviewed-on: https://go-review.googlesource.com/20024 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Shenghou Ma authored
Fixes #14557. Change-Id: I9610b79aafe9c15f9c998739b586fd0b41b90d70 Reviewed-on: https://go-review.googlesource.com/20031Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
Mostly renaming variables for clarity. Passes toolstash -cmp. Change-Id: I9867137c34c14985cbbbdb2d34fbbe4cc65cb6fb Reviewed-on: https://go-review.googlesource.com/20023Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
Passes toolstash -cmp. Casual timings show about a 3% improvement in compile times. Update #14473. Change-Id: I584add2e8f1a52486ba418b25ba6122b7347b643 Reviewed-on: https://go-review.googlesource.com/19989Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Martin Möhrmann authored
Do not replace the sign in front of a number with a space if both f.space and f.plus are both specified for number formatting. This was already the case for integers but not for floats and complex numbers. Updates: #14543. Change-Id: I07ddeb505003db84a8a7d2c743dc19fc427a00bd Reviewed-on: https://go-review.googlesource.com/19974 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Ian Lance Taylor authored
Besides being more efficient in a large build, this avoids a possible race when creating the input file. Change-Id: Ifc2cb055925a76be9c90eac56d84ebd9e14f2bbc Reviewed-on: https://go-review.googlesource.com/19392Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
-
- 28 Feb, 2016 1 commit
-
-
David Chase authored
Avoid targeting a partial register with load; ensure source of load (writebarrier) is aligned. Better yet would be "CMPB $1,writebarrier" but that requires wrestling with flagalloc (mem operand complicates moving instruction around). Didn't see a change in time for benchcmd -n 10 Build go build net/http Verified that we clean the code up properly: 0x20a8 <main.main+104>: mov 0xc30a2(%rip),%eax # 0xc5150 <runtime.writeBarrier> 0x20ae <main.main+110>: test %al,%al Change-Id: Id5fb8c260eaec27bd727cb0ae1476c60343b0986 Reviewed-on: https://go-review.googlesource.com/19998Reviewed-by: Keith Randall <khr@golang.org>
-