- 23 Feb, 2016 3 commits
-
-
Alexandru Moșoi authored
While investigating the differences between 19710 (remove tautological controls) and 12960 (bounds and nil propagation) I observed that part of the wins of 19710 come from missed opportunities for deadcode elimination due to phis. See for example runtime.stackcacherelease. 19710 happens much later than 12960 and has more chances to eliminate bounds. Size of pkg/tool/linux_amd64/* excluding compile: -this -12960 95882248 +this -12960 95880120 -this +12960 95581512 +this +12960 95555224 This change saves about 25k. Change-Id: Id2f4e55fc92b71595842ce493c3ed527d424fe0e Reviewed-on: https://go-review.googlesource.com/19728Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Todd Neal authored
The upper bits of 8/16/32 bit constants are undefined. We need to truncate in order to prevent x86.oclass misidentifying the size of the constant. Fixes #14389 Change-Id: I3e5ff79cd904376572a93f489ba7e152a5cb6e60 Reviewed-on: https://go-review.googlesource.com/19740Reviewed-by: Keith Randall <khr@golang.org>
-
Todd Neal authored
Loads of stores from the same pointer with compatible types can be replaced with a copy. Change-Id: I514b3ed8e5b6a9c432946880eac67a51b1607932 Reviewed-on: https://go-review.googlesource.com/19743 Run-TryBot: Todd Neal <todd@tneal.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
- 22 Feb, 2016 5 commits
-
-
David Chase authored
Replaced comparison based on (*Type).String() with an allocation-free structural comparison. Roughly doubles speed of CSE, also reduces allocations. Checked that roughly the same number of CSEs were detected during make.bash (about a million) and that "new" CSEs were caused by the effect described above. Change-Id: Id205a9f6986efd518043e12d651f0b01206aeb1b Reviewed-on: https://go-review.googlesource.com/19471Reviewed-by: Keith Randall <khr@golang.org>
-
Alexandru Moșoi authored
* If a operation is commutative order the parameters in a canonical way. Size of pkg/tool/linux_amd64/* excluding compile: before: 95882288 after: 95868152 change: 14136 ~0.015% I tried something similar with Leq and Geq, but the results were not great because it confuses the 'lowered cse' pass too much which can no longer remove redundant comparisons from IsInBounds. Change-Id: I2f928663a11320bfc51c7fa47e384b7411c420ba Reviewed-on: https://go-review.googlesource.com/19727Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
David Chase authored
Spotted a minor source of excess allocation in the register allocator. Rearranged the dominator tree code to pull its scratch memory from a reused buffer attached to Config. Change-Id: I6da6e7b112f7d3eb1fd00c58faa8214cdea44e38 Reviewed-on: https://go-review.googlesource.com/19450Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Todd Neal authored
Add an initial cse pass that only operates on zero argument values. This removes the need for a special case in cse for removing OpSB and speeds up arithConst_ssa.go compilation by 9% while slowing "test -c net/http" by 1.5%. Change-Id: Id1500482485426f66c6c2eba75eeaf4f19c8a889 Reviewed-on: https://go-review.googlesource.com/19454 Run-TryBot: Todd Neal <todd@tneal.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Todd Neal authored
This adds a test case with aliased pointers to ensure modifications to dse don't remove valid stores. Change-Id: I143653250f46a403835218ec685bcd336d5087ef Reviewed-on: https://go-review.googlesource.com/19795Reviewed-by: Keith Randall <khr@golang.org>
-
- 19 Feb, 2016 2 commits
-
-
Alexandru Moșoi authored
Change-Id: Idd880cc6c1e5dc34dddbdea0841a7a718d2fa836 Reviewed-on: https://go-review.googlesource.com/19544Reviewed-by: David Chase <drchase@google.com>
-
Alexandru Moșoi authored
Change-Id: I731722eb77f373ff7d6101f93830ab0a50497e2c Reviewed-on: https://go-review.googlesource.com/19542 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
- 18 Feb, 2016 1 commit
-
-
David Chase authored
Tested it 1000x on OS X and Linux amd64, no failures. Updated TODO. Change-Id: Ia60c8d90962f6e5f7c3ed1ded6ba1b25eee983e1 Reviewed-on: https://go-review.googlesource.com/19662Reviewed-by: Todd Neal <todd@tneal.org>
-
- 17 Feb, 2016 2 commits
-
-
Alexandru Moșoi authored
Also throw in a few more shift constant folding. Change-Id: Iabe00596987f594e0686fbac3d76376d94612340 Reviewed-on: https://go-review.googlesource.com/19543 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Alexandru Moșoi authored
* In cases where we end up with empty branches like in if a then jmp b else jmp b; the flow can be replaced by a; jmp b. The following functions is optimized as follows: func f(a bool, x int) int { v := 0 if a { v = -1 } else { v = -1 } return x | v } Before this change: 02819 (arith_ssa.go:362) VARDEF "".~r2+16(FP) 02820 (arith_ssa.go:362) MOVQ $0, "".~r2+16(FP) 02821 (arith_ssa.go:362) MOVB "".a(FP), AX 02822 (arith_ssa.go:362) TESTB AX, AX 02823 (arith_ssa.go:364) JEQ 2824 02824 (arith_ssa.go:369) VARDEF "".~r2+16(FP) 02825 (arith_ssa.go:369) MOVQ $-1, "".~r2+16(FP) 02826 (arith_ssa.go:369) RET After this change: 02819 (arith_ssa.go:362) VARDEF "".~r2+16(FP) 02820 (arith_ssa.go:369) VARDEF "".~r2+16(FP) 02821 (arith_ssa.go:369) MOVQ $-1, "".~r2+16(FP) 02822 (arith_ssa.go:369) RET Updates #14277 Change-Id: Ibe7d284f43406c704903632a4fcf2a4a64059686 Reviewed-on: https://go-review.googlesource.com/19464Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 16 Feb, 2016 2 commits
-
-
Alexandru Moșoi authored
* Merge copyelim into phielim. * Add phielimValue to rewrite. cgoIsGoPointer is, for example, 2 instructions smaller now. Change-Id: I8baeb206d1b3ef8aba4a6e3bcdc432959bcae2d5 Reviewed-on: https://go-review.googlesource.com/19462Reviewed-by: David Chase <drchase@google.com>
-
Todd Neal authored
ANDs of constants whose only set bits are leading or trailing can be rewritten as two shifts instead. This is slightly faster for 32 or 64 bit operands. Change-Id: Id5c1ff27e5a4df22fac67b03b9bddb944871145d Reviewed-on: https://go-review.googlesource.com/19485 Run-TryBot: Todd Neal <todd@tneal.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
- 12 Feb, 2016 1 commit
-
-
Todd Neal authored
When printing a value with just an aux, print the aux as well. Debugging cse is easier when the aux values are visible. Change-Id: Ifaf96bdb25462c9df7ba01fdfdbf0d379631f555 Reviewed-on: https://go-review.googlesource.com/19476Reviewed-by: Keith Randall <khr@golang.org>
-
- 11 Feb, 2016 2 commits
-
-
Gerrit Code Review authored
-
Keith Randall authored
Flagalloc was recalculating flags is some situations when it didn't need to. Fixed by using the same name for the original flag calculation instruction throughout. Change-Id: Ic0bf58f728a8d87748434dd25a67b0708755e1f8 Reviewed-on: https://go-review.googlesource.com/19237 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
- 10 Feb, 2016 1 commit
-
-
Keith Randall authored
Semi-regular merge from tip to dev.ssa. Two fixes: 1) Mark selectgo as not returning. This caused problems because there are no VARKILL ops on the selectgo path, causing things to be marked live that shouldn't be. 2) Tell the amd64 assembler that addressing modes like name(SP)(AX*4) are ok. Change-Id: I9ca81c76391b1a65cc47edc8610c70ff1a621913
-
- 09 Feb, 2016 5 commits
-
-
Alexandru Moșoi authored
Found by inspecting random generated code. Change-Id: I57d0fed7c3a8dc91fd13cdccb4819101f9976ec9 Reviewed-on: https://go-review.googlesource.com/19413Reviewed-by: Keith Randall <khr@golang.org>
-
Alexandru Moșoi authored
* Phis can have variable number of arguments, but rulegen assumed that each operation has fixed number of arguments. * Rewriting Phis is necessary to handle the following case: func f1_ssa(a bool, x int) int { v := 0 if a { v = -1 } else { v = -1 } return x|v } Change-Id: Iff6bd411b854f3d1d6d3ce21934bf566757094f2 Reviewed-on: https://go-review.googlesource.com/19412Reviewed-by: Keith Randall <khr@golang.org>
-
Keith Randall authored
A first pass to decompose user types (structs, maybe arrays someday), and a second pass to decompose builtin types (strings, interfaces, slices, complex). David wants this for value range analysis so he can have structs decomposed but slices and friends will still be intact and he can deduce things like the length of a slice is >= 0. Change-Id: Ia2300d07663329b51ed6270cfed21d31980daa7c Reviewed-on: https://go-review.googlesource.com/19340 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: David Chase <drchase@google.com>
-
Todd Neal authored
Adds a test to detect the bug that slipped in earlier when partioning by the Aux value, but not sorting by it. Change-Id: I56d0ba76383bbc1514b3dabd295e369771c26645 Reviewed-on: https://go-review.googlesource.com/19382 Run-TryBot: Todd Neal <todd@tneal.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Brad Fitzpatrick authored
ListenAndServeTLS doesn't require cert and key file names if the server's TLSConfig has a cert configured. This code was never updated when the GetCertificate hook was added to *tls.Config, however. Fixes #14268 Change-Id: Ib282ebb05697edd37ed8ff105972cbd1176d900b Reviewed-on: https://go-review.googlesource.com/19381Reviewed-by: Russ Cox <rsc@golang.org>
-
- 08 Feb, 2016 7 commits
-
-
Robert Griesemer authored
Fixes #14262. Change-Id: Id590995dd4460e81f6b91bcfb3f02515a97650fe Reviewed-on: https://go-review.googlesource.com/19361 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Fixes #14259 Change-Id: I23fedec0eb85ae28e56bc24539bc864674856130 Reviewed-on: https://go-review.googlesource.com/19318Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ilya Tocar authored
INC/DEC produces slightly faster and smaller code. Change-Id: I329d9bdb01b90041be45e053d9df640818bf0c2d Reviewed-on: https://go-review.googlesource.com/19238 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Alexandru Moșoi authored
Change-Id: Id51e5c97e9653b764b809bf3424f1a6d31b6ffea Reviewed-on: https://go-review.googlesource.com/19338 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: David Chase <drchase@google.com>
-
David Chase authored
Problem was caused by use of Args[].Aux differences in early partitioning. This artificially separated two equivalent expressions because sort ignores the Aux field, hence things can end with equal things separated by unequal things and thus the equal things are split into more than one partition. For example: SliceLen(a), SliceLen(b), SliceLen(a). Fix: don't use Args[].Aux in initial partitioning. Left in a debugging flag and some debugging Fprintf's; not sure if that is house style or not. We'll probably want to be more systematic in our naming conventions, e.g. ssa.cse, ssa.scc, etc. Change-Id: Ib1412539cc30d91ea542c0ac7b2f9b504108ca7f Reviewed-on: https://go-review.googlesource.com/19316Reviewed-by: Keith Randall <khr@golang.org>
-
Robert Griesemer authored
The operation where this manifested in a crash was % (only defined on integers). However, the existing code was sloppy in that it didn't retain the integer form after a value (e.g., 3.0) was accepted as representable in integer form (3 for the example). We would have seen a crash in such cases for / as well except that there was code to fix it for just that case. Remove the special code for / and fix more generally by retaining the integer form for all operations if applicable. Fixes #14229. Change-Id: I8bef769e6299839fade27c6e8b5ff29ad6521d0d Reviewed-on: https://go-review.googlesource.com/19300Reviewed-by: Alan Donovan <adonovan@google.com>
-
Todd Neal authored
Examine both Aux and AuxInt to form more precise initial partitions. Restructure loop to avoid repeated type.Equal() call. Speeds up compilation of testdata/gen/arithConst_ssa by 25%. Change-Id: I3cfb1d254adf0601ee69239e1885b0cf2a23575b Reviewed-on: https://go-review.googlesource.com/19313 Run-TryBot: Todd Neal <todd@tneal.org> Reviewed-by: Keith Randall <khr@golang.org>
-
- 07 Feb, 2016 2 commits
-
-
Keith Randall authored
Panic doesn't return, so record that we immediately exit after a panic call. This will help code analysis. Change-Id: I4d1f67494f97b6aee130c43ff4e44307b2b0f149 Reviewed-on: https://go-review.googlesource.com/19303 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Mikio Hara authored
Change-Id: I630d4d2d8a914d6c07f22351a56d5e44a937123e Reviewed-on: https://go-review.googlesource.com/19245Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 06 Feb, 2016 2 commits
-
-
Ian Lance Taylor authored
The test sends two HTTP/1.1 pipelined requests. The first is completedly by the second, and as such triggers an immediate call to the CloseNotify channel. The second calls the CloseNotify channel after the overall connection is closed. The test was passing fine on gc because the code would enter the select loop before running the handler, so the send on gotReq would always be seen first. On gccgo the code would sometimes enter the select loop after the handler had already finished, meaning that the select could choose between gotReq and sawClose. If it picked sawClose, it would never close the overall connection, and the httptest server would hang. The same hang could be induced with gc by adding a time.Sleep immediately before the select loop. Deflake the test by 1) don't close the overall connection until both requests have been seen; 2) don't exit the loop until both closes have been seen. Fixes #14231. Change-Id: I9d20c309125422ce60ac545f78bcfa337aec1c7d Reviewed-on: https://go-review.googlesource.com/19281Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Keith Randall authored
The frontend does this for 32 bits and below, but SSA needs to do it for 64 bits. The algorithms are all copied from cgen.go:cgen_div. Speeds up TimeFormat substantially: ~40% slower to ~10% slower. Change-Id: I023ea2eb6040df98ccd9105e15ca6ea695610a7a Reviewed-on: https://go-review.googlesource.com/19302 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Todd Neal <todd@tneal.org>
-
- 05 Feb, 2016 5 commits
-
-
Brad Fitzpatrick authored
Change-Id: I93201fa4152f2d60b3eedb8d321a152819033121 Reviewed-on: https://go-review.googlesource.com/19270Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Keith Randall authored
Use just a single write barrier flag test, even if there are multiple pointer fields in a struct. This helps move more of the wb-specific code (like the LEA needed to materialize the write address) into the unlikely path. Change-Id: Ic7a67145904369c4ff031e464d51267d71281c8f Reviewed-on: https://go-review.googlesource.com/19085 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Brad Fitzpatrick authored
Updates x/net/http2 to git rev 493a262 for https://golang.org/cl/19223 Fixes #14227 Change-Id: I626122811138fb3d88e4eea83f8da3fdcf91e0dc Reviewed-on: https://go-review.googlesource.com/19250Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Keith Randall authored
Change-Id: Ifb8eba1929c79ee7a8cae2191613c55a3b8f74e5 Reviewed-on: https://go-review.googlesource.com/19236Reviewed-by: Todd Neal <todd@tneal.org>
-
Brad Fitzpatrick authored
Updates #14227 Change-Id: If39f11471ecd307c9483f64e73f9c89fe906ae71 Reviewed-on: https://go-review.googlesource.com/19222Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-