- 24 Jun, 2015 2 commits
-
-
Josh Bleecher Snyder authored
Somehow I missed this in CL 11160. Without it, all.bash fails on fixedbugs/bug303.go. The right fix is probably to discard the variable and keep going, even though the code is dead. For now, defer the decision by declaring such situations unimplemented and get the build fixed. Change-Id: I679197f780c7a3d3eb7d05e91c86a4cdc3b70131 Reviewed-on: https://go-review.googlesource.com/11440Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
The nilcheckelim pass eliminates unnecessary nil checks. The initial implementation removes redundant nil checks. See the comments in nilcheck.go for ideas for future improvements. The efficacy of the cse pass has a significant impact on this efficacy of this pass. There are 886 nil checks in the parts of the standard library that SSA can currently compile (~20%). This pass eliminates 75 (~8.5%) of them. As a data point, with a more aggressive but unsound cse pass that treats many more types as identical, this pass eliminates 115 (~13%) of the nil checks. Change-Id: I13e567a39f5f6909fc33434d55c17a7e3884a704 Reviewed-on: https://go-review.googlesource.com/11430Reviewed-by: Alan Donovan <adonovan@google.com>
-
- 21 Jun, 2015 1 commit
-
-
Josh Bleecher Snyder authored
The SSA implementation logs for three purposes: * debug logging * fatal errors * unimplemented features Separating these three uses lets us attempt an SSA implementation for all functions, not just _ssa functions. This turns the entire standard library into a compilation test, and makes it easy to figure out things like "how much coverage does SSA have now" and "what should we do next to get more coverage?". Functions called _ssa are still special. They log profusely by default and the output of the SSA implementation is used. For all other functions, logging is off, and the implementation is built and discarded, due to lack of support for the runtime. While we're here, fix a few minor bugs and add some extra Unimplementeds to allow all.bash to pass. As of now, SSA handles 20.79% of the functions in the standard library (689 of 3314). The top missing features are: 10.03% 2597 SSA unimplemented: zero for type error not implemented 7.79% 2016 SSA unimplemented: addr: bad op DOTPTR 7.33% 1898 SSA unimplemented: unhandled expr EQ 6.10% 1579 SSA unimplemented: unhandled expr OROR 4.91% 1271 SSA unimplemented: unhandled expr NE 4.49% 1163 SSA unimplemented: unhandled expr LROT 4.00% 1036 SSA unimplemented: unhandled expr LEN 3.56% 923 SSA unimplemented: unhandled stmt CALLFUNC 2.37% 615 SSA unimplemented: zero for type []byte not implemented 1.90% 492 SSA unimplemented: unhandled stmt CALLMETH 1.74% 450 SSA unimplemented: unhandled expr CALLINTER 1.74% 450 SSA unimplemented: unhandled expr DOT 1.71% 444 SSA unimplemented: unhandled expr ANDAND 1.65% 426 SSA unimplemented: unhandled expr CLOSUREVAR 1.54% 400 SSA unimplemented: unhandled expr CALLMETH 1.51% 390 SSA unimplemented: unhandled stmt SWITCH 1.47% 380 SSA unimplemented: unhandled expr CONV 1.33% 345 SSA unimplemented: addr: bad op * 1.30% 336 SSA unimplemented: unhandled OLITERAL 6 Change-Id: I4ca07951e276714dc13c31de28640aead17a1be7 Reviewed-on: https://go-review.googlesource.com/11160Reviewed-by: Keith Randall <khr@golang.org>
-
- 17 Jun, 2015 3 commits
-
-
Michael Matloob authored
I don't have strong understanding of the AST structure, so I'm not sure if this is the right way to handle function call statements. Change-Id: Ib526f667ab483b32d9fd17da800b5d6f4b26c4c9 Reviewed-on: https://go-review.googlesource.com/11139Reviewed-by: Keith Randall <khr@golang.org>
-
Michael Matloob authored
Change-Id: I33025a4a41fd91f6ee317d33a6eebf27fa00ab51 Reviewed-on: https://go-review.googlesource.com/11115Reviewed-by: Keith Randall <khr@golang.org>
-
Michael Matloob authored
This CL sets line numbers on Values in the newValue variants introduced in cl/10929. Change-Id: Ibd15bc90631a1e948177878ea4191d995e8bb19b Reviewed-on: https://go-review.googlesource.com/11090Reviewed-by: Keith Randall <khr@golang.org>
-
- 16 Jun, 2015 3 commits
-
-
Josh Bleecher Snyder authored
Compilation of f_ssa was broken by CL 10929. This CL does not include tests because I have a work in progress CL that will catch this and much more. package p func f_ssa() string { return "ABC" } Change-Id: I0ce0e905e4d30ec206cce808da406b9b7f0f38e9 Reviewed-on: https://go-review.googlesource.com/11136Reviewed-by: Keith Randall <khr@golang.org>
-
Keith Randall authored
The cmd/compile/internal/ssa/gen directory can't depend on cmd/internal/gc because that package doesn't exist in go1.4. Use strings instead of constants from that package. The asm fields seem somewhat redundant to the opcode names we conventionally use. Maybe we can just trim the lowercase from the end of the op name? At least by default? Change-Id: I96e8cda44833763951709e2721588fbd34580989 Reviewed-on: https://go-review.googlesource.com/11129Reviewed-by: Michael Matloob <michaelmatloob@gmail.com>
-
Michael Matloob authored
Add an asm field to opcodeTable containing the Prog's as field. Then instructions that fill the Prog the same way can be collapsed into a single switch case. I'm still thinking of a better way to reduce redundancy, but I think this might be a good temporary solution to prevent duplication from getting out of control. What do you think? Change-Id: I0c4a0992741f908bd357ee2707edb82e76e4ce61 Reviewed-on: https://go-review.googlesource.com/11130Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Keith Randall <khr@golang.org>
-
- 15 Jun, 2015 1 commit
-
-
Daniel Morsing authored
This caused the following code snippet to be miscompiled var f int x := g(&f) f = 10 Moving the store of 10 above the function call. Change-Id: Ic6951f5e7781b122cd881df324a38e519d6d66f0 Reviewed-on: https://go-review.googlesource.com/11073Reviewed-by: Keith Randall <khr@golang.org>
-
- 14 Jun, 2015 7 commits
-
-
Daniel Morsing authored
Call to the runtime to generate escaping variables and use the returned address when accessing these variables. Fix a couple of errors on the way. The rule for CALLstatic was missed during the Aux refactor and OCONVNOP wasn't converted. Change-Id: I2096beff92cca92d648bfb6e8ec0b120f02f44af Reviewed-on: https://go-review.googlesource.com/11072Reviewed-by: Keith Randall <khr@golang.org>
-
Michael Matloob authored
Change-Id: I235a759e4688358adc088cf5a80f8ce7ad12d2f2 Reviewed-on: https://go-review.googlesource.com/11093Reviewed-by: Keith Randall <khr@golang.org>
-
Michael Matloob authored
In the previous line number CL the NewValue\d? functions took a line number argument but neglected to set the Line field on the value struct. Fix that. Change-Id: I53c79ff93703f66f5f0266178c94803719ae2074 Reviewed-on: https://go-review.googlesource.com/11054Reviewed-by: Keith Randall <khr@golang.org>
-
Michael Matloob authored
TESTQ is produced by the IsNonNil lowering. Change-Id: I9df8f17e6def7e34d07e3ddf2dd5dd8f0406aa04 Reviewed-on: https://go-review.googlesource.com/11053Reviewed-by: Keith Randall <khr@golang.org>
-
Daniel Morsing authored
If there isn't a value dependency between the control value of a block and some other value, the schedule pass might move the control value to a spot that is not EOB. Fix by handling the control value specially like phis. Change-Id: Iddaf0924d98c5b3d9515c3ced927b0c85722818c Reviewed-on: https://go-review.googlesource.com/11071Reviewed-by: Keith Randall <khr@golang.org>
-
Keith Randall authored
Add an additional int64 auxiliary field to Value. There are two main reasons for doing this: 1) Ints in interfaces require allocation, and we store ints in Aux a lot. 2) I'd like to have both *gc.Sym and int offsets included in lots of operations (e.g. MOVQloadidx8). It will be more efficient to store them as separate fields instead of a pointer to a sym/int pair. It also simplifies a bunch of code. This is just the refactoring. I'll start using this some more in a subsequent changelist. Change-Id: I1ca797ff572553986cf90cab3ac0a0c1d01ad241 Reviewed-on: https://go-review.googlesource.com/10929Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Keith Randall authored
Allow labels to be unreachable via fallthrough from above. Implement OCONVNOP. Change-Id: I6869993cad8a27ad134dd637de89a40117daf47b Reviewed-on: https://go-review.googlesource.com/11001Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
-
- 12 Jun, 2015 2 commits
-
-
Daniel Morsing authored
ODCL nodes are used as the point where the variable is allocated in the old pass. colas is irrelevant at this point of the compile. All the checks on it happen at parse time and an ODCL node will have been inserted right before it. Change-Id: I1aca053aaa4363bacd12e1156de86fa7b6190a55 Reviewed-on: https://go-review.googlesource.com/10901Reviewed-by: Keith Randall <khr@golang.org>
-
Josh Bleecher Snyder authored
Change-Id: I6c6196449dd3d5e036d420fa7ae90feb0cf8d417 Reviewed-on: https://go-review.googlesource.com/10928Reviewed-by: Keith Randall <khr@golang.org>
-
- 11 Jun, 2015 10 commits
-
-
Keith Randall authored
Semi-regular merge of tip into dev.ssa. Change-Id: Iec8e4266426bed233892e7dbe4448d16c8b89018
-
Brad Fitzpatrick authored
Forgot this one in my previous commit. Change-Id: Ief089e99bdad24b3bcfb075497dc259d06cc727c Reviewed-on: https://go-review.googlesource.com/10913Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Chris Broadfoot authored
Change-Id: Idc4a7fdb561ba5b3b52094d895deaf3fcdf475bf Reviewed-on: https://go-review.googlesource.com/10716Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Brad Fitzpatrick authored
Might get the Android build passing, or at least going further. Change-Id: I08f97156a687abe5a3d95203922f4ffd84fbb212 Reviewed-on: https://go-review.googlesource.com/10924Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Ainar Garipov authored
These were found by grepping the comments from the go code and feeding the output to aspell. Change-Id: Id734d6c8d1938ec3c36bd94a4dbbad577e3ad395 Reviewed-on: https://go-review.googlesource.com/10941Reviewed-by: Aamir Khan <syst3m.w0rm@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
David du Colombier authored
This issue was fixed in CL 10900. Change-Id: I88f107cb73c8a515f39e02506ddd2ad1e286b1fb Reviewed-on: https://go-review.googlesource.com/10940 Run-TryBot: David du Colombier <0intro@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
David du Colombier authored
When the Stat or Fstat system calls return -1, dirstat incorrectly returns ErrShortStat. However, the error returned by Stat or Fstat could be different. For example, when the file doesn't exist, they return "does not exist". Dirstat should return the error returned by the system call. Fixes #10911. Fixes #11132. Change-Id: Icf242d203d256f12366b1e277f99b1458385104a Reviewed-on: https://go-review.googlesource.com/10900 Run-TryBot: David du Colombier <0intro@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Keith Randall authored
Implement correct Go shifts. Allow multi-line rewrite rules. Fix offset & alignment in stack alloc. Change-Id: I0ae9e522c83df9205bbe4ab94bc0e43d16dace58 Reviewed-on: https://go-review.googlesource.com/10891Reviewed-by: Keith Randall <khr@golang.org>
-
Keith Randall authored
Add calls, particularly closure calls. Reorg SSAable variable test for converting to SSA. Change-Id: Ia75c04295e6b0b040122f97e2381836a393b7f42 Reviewed-on: https://go-review.googlesource.com/10912Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Patrick Mezard authored
Process.handle was accessed without synchronization while wait() and signal() could be called concurrently. A first solution was to add a Mutex in Process but it was probably too invasive given Process.handle is only used on Windows. This version uses atomic operations to read the handle value. There is still a race between isDone() and the value of the handle, but it only leads to slightly incorrect error codes. The caller may get a: errors.New("os: process already finished") instead of: syscall.EINVAL which sounds harmless. Fixes #9382 Change-Id: Iefcc687a1166d5961c8f27154647b9b15a0f748a Reviewed-on: https://go-review.googlesource.com/9904Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 10 Jun, 2015 7 commits
-
-
Ian Lance Taylor authored
Change-Id: I8473e3f7653d5389d5fcd94862f0831049b8266e Reviewed-on: https://go-review.googlesource.com/10809Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Fixes #11144 Change-Id: I1da0b72ef00a84c9b5751be0e72ad07d664bc98b Reviewed-on: https://go-review.googlesource.com/10883Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
-
Michael Matloob authored
Change-Id: I1dfffd75cc1f49307c654f910f7133c03da6c84f Reviewed-on: https://go-review.googlesource.com/10559Reviewed-by: Keith Randall <khr@golang.org>
-
Ainar Garipov authored
Change-Id: I82edd9364e1b4634006f5e043202a69f383dcdbe Reviewed-on: https://go-review.googlesource.com/10826Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Alex Brainman authored
Update #10254 Change-Id: I3ddd26607813ca629e3ab62abf87dc5ab453e36f Reviewed-on: https://go-review.googlesource.com/10835Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Yongjian Xu authored
Change-Id: Ida4b98aa63e57594fa6fa0b8178106bac9b3cd19 Reviewed-on: https://go-review.googlesource.com/10837Reviewed-by: Minux Ma <minux@golang.org>
-
Josh Bleecher Snyder authored
Change-Id: I95b72b6be39fbb923b5f0743d17d7f8bd3ee3814 Reviewed-on: https://go-review.googlesource.com/10860Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 09 Jun, 2015 4 commits
-
-
Burcu Dogan authored
Change-Id: I1ec2460758b19e5315be061033c1bb5ed9ead4a8 Reviewed-on: https://go-review.googlesource.com/9688Reviewed-by: Minux Ma <minux@golang.org>
-
Josh Bleecher Snyder authored
This was a refactoring bug during 'go tool compile', CL 10289. Change-Id: Ibfd333be39ec72bba331fdf352df619cc21851a9 Reviewed-on: https://go-review.googlesource.com/10849Reviewed-by: Minux Ma <minux@golang.org>
-
Adam Langley authored
Change-Id: I7cad3f7af2452e29b3dae3da87cbd24013f6dae6 Reviewed-on: https://go-review.googlesource.com/10850Reviewed-by: Adam Langley <agl@golang.org>
-
Carl Jackson authored
GCM is traditionally used with a 96-bit nonce, but the standard allows for nonces of any size. Non-standard nonce sizes are required in some protocols, so add support for them in crypto/cipher's GCM implementation. Change-Id: I7feca7e903eeba557dcce370412b6ffabf1207ab Reviewed-on: https://go-review.googlesource.com/8946Reviewed-by: Adam Langley <agl@golang.org> Run-TryBot: Adam Langley <agl@golang.org>
-