- 03 Nov, 2015 3 commits
-
-
Keith Randall authored
Declare a function's arguments as having already been spilled so their use just requires a restore. Allow spill locations to be portions of larger objects the stack. Required to load portions of compound input arguments. Rename the memory input to InputMem. Use Arg for the pre-spilled argument values. Change-Id: I8fe2a03ffbba1022d98bfae2052b376b96d32dda Reviewed-on: https://go-review.googlesource.com/16536 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Keith Randall authored
Be more consistent about this. There's no reason to do the pointer arithmetic on a different type, as sizeof(int) >= sizeof(ptr) on all of our platforms. It simplifies our rewrite rules also, except for a few that need duplication. Add some more constant folding to get constant indexing and slicing to fold down to nothing. Change-Id: I3e56cdb14b3dc1a6a0514f0333e883f92c19e3c7 Reviewed-on: https://go-review.googlesource.com/16586 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Keith Randall authored
For the statement if a && b { target } the old code allocated a new variable v and did: v = a if a { v = b } if v { goto target } The new code does: if a { if b { goto target } } The new arrangement tends to generate much more efficient code. In particular, there is no temporary variable and there is only one join point instead of two. The old code is still used for ANDAND and OROR which are not direct descendents of IF or FOR statements. Change-Id: I082f246d27c823c6f32d1287300e4b0911607507 Reviewed-on: https://go-review.googlesource.com/16584 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
- 30 Oct, 2015 2 commits
-
-
David Chase authored
Some tests disabled, some bifurcated into _ssa and not, with appropriate logging added to compiler. "tests/live.go" in particular needs attention. SSA-specific testing removed, since it's all SSA now. Added "-run_skips" option to tests/run.go to simplify checking whether a test still fails (or how it fails) on a skipped platform. The compiler now compiles with SSA by default. If you don't want SSA, specify GOSSAHASH=n (or N) as an environment variable. Function names ending in "_ssa" are always SSA-compiled. GOSSAFUNC=fname retains its "SSA for fname, log to ssa.html" GOSSAPKG=pkg only has an effect when GOSSAHASH=n GOSSAHASH=10101 etc retains its name-hash-matching behavior for purposes of debugging. See #13068 Change-Id: I8217bfeb34173533eaeb391b5f6935483c7d6b43 Reviewed-on: https://go-review.googlesource.com/16299Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David Chase <drchase@google.com>
-
Todd Neal authored
Shaves ~8k off the go binary on darwin x64. Change-Id: I73396af44ae28cd4cfc675290d6858f304d45b76 Reviewed-on: https://go-review.googlesource.com/16456 Run-TryBot: Todd Neal <todd@tneal.org> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 29 Oct, 2015 1 commit
-
-
Keith Randall authored
We "spill" flag values by recomputing them from their original inputs. The "find original inputs" part of the algorithm was a hack. It was broken by rematerialization. This change does the real job of keeping track of original values for each spill/restore/flagrecompute/rematerialization we issue. Change-Id: I95088326a4ee4958c98148b063e518c80e863e4c Reviewed-on: https://go-review.googlesource.com/16500 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 28 Oct, 2015 6 commits
-
-
Todd Neal authored
This improves cse and works correctly now that divide by zero is checked explicitly. Change-Id: If54fbe403ed5230b897afc5def644ba9f0056dfd Reviewed-on: https://go-review.googlesource.com/16454 Run-TryBot: Todd Neal <todd@tneal.org> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Keith Randall authored
The single value rewrite function is too big. Some compilers fail on it (out of memory, branch offset too large). Break it up into a rewrite function per op. Change-Id: Iede697c8a1a3a22b485cd0dc85d3e233160c89c2 Reviewed-on: https://go-review.googlesource.com/16347 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Todd Neal <todd@tneal.org>
-
Keith Randall authored
SSA generates ACALL assembly with the target in a *Sym. The old compiler generates both that *Sym and a *Node. Use the *Sym to print the live info so it works with both compilers. Change-Id: I0b12a161f83e76638604358c21b9f5abb31ce950 Reviewed-on: https://go-review.googlesource.com/16432 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
David Chase authored
Added an explicit compare-zero and branch-to-panic for integer division and mod so that other optimizations will not be fooled by their implicit panics. Change-Id: Ibf96f636b541c0088861907c537a6beb4b99fa4c Reviewed-on: https://go-review.googlesource.com/16450Reviewed-by: Keith Randall <khr@golang.org>
-
Keith Randall authored
For debugging, spill values to named variables instead of autotmp_ variables if possible. We do this by keeping a name -> value map for each function, keep it up-to-date during deadcode elim, and use it to override spill decisions in stackalloc. It might even make stack frames a bit smaller, as it makes it easy to identify a set of spills which are likely not to interfere. This just works for one-word variables for now. Strings/slices will be a separate CL. Change-Id: Ie89eba8cab16bcd41b311c479ec46dd7e64cdb67 Reviewed-on: https://go-review.googlesource.com/16336 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Keith Randall authored
Introduce opcodes that store a constant value. AuxInt now needs to hold both the value to be stored and the constant offset at which to store it. Introduce a StoreConst type to help encode/decode these parts to/from an AuxInt. Change-Id: I1631883abe035cff4b16368683e1eb3d2ccb674d Reviewed-on: https://go-review.googlesource.com/16170Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
- 27 Oct, 2015 3 commits
-
-
Todd Neal authored
deadstore elimination currently works in a block, fusing before performing dse eliminates ~1% more stores for make.bash Change-Id: If5bbddac76bf42616938a8e8e84cb7441fa02f73 Reviewed-on: https://go-review.googlesource.com/16350Reviewed-by: Keith Randall <khr@golang.org>
-
Keith Randall authored
If the closure pointer gets spilled, we need to spill it with pointer type to make stack copy and GC happy. Change-Id: Ic108748e6b9caecd45522141f02c9422567376e3 Reviewed-on: https://go-review.googlesource.com/16363 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Keith Randall authored
Replace REP MOVSB with all the copying techniques used by the old compiler. Copy in chunks, DUFFCOPY, etc. Introduces MOVO opcodes and an Int128 type to move around 16 bytes at a time. Change-Id: I1e73e68ca1d8b3dd58bb4af2f4c9e5d9bf13a502 Reviewed-on: https://go-review.googlesource.com/16174Reviewed-by: Todd Neal <todd@tneal.org> Run-TryBot: Keith Randall <khr@golang.org>
-
- 25 Oct, 2015 1 commit
-
-
Keith Randall authored
Use faulting loads instead of test/jeq to do nil checks. Fold nil checks into a following load/store if possible. Makes binaries about 2% smaller. Change-Id: I54af0f0a93c853f37e34e0ce7e3f01dd2ac87f64 Reviewed-on: https://go-review.googlesource.com/16287Reviewed-by: David Chase <drchase@google.com>
-
- 23 Oct, 2015 4 commits
-
-
Keith Randall authored
unsafe.Pointer->uintptr, add, then uintptr->unsafe.Pointer. Do the add directly on the pointer type instead. Change-Id: I5a3a32691d0a000e16975857974ed9a1039c6d28 Reviewed-on: https://go-review.googlesource.com/16281 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
David Chase authored
Modified GOSSA{HASH.PKG} environment variable filters to make it easier to make/run with all SSA for testing. Disable attempts at SSA for architectures that are not amd64 (avoid spurious errors/unimplementeds.) Removed easy out for unimplemented features. Add convert op for proper liveness in presence of uintptr to/from unsafe.Pointer conversions. Tweaked stack sizes to get a pass on windows; 1024 instead 768, was observed to pass at least once. Change-Id: Ida3800afcda67d529e3b1cf48ca4a3f0fa48b2c5 Reviewed-on: https://go-review.googlesource.com/16201Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David Chase <drchase@google.com>
-
David Chase authored
Calls to NewConfig required an extra parameter that sometimes could not be nil. Change-Id: I806dd53c045056a0c2d30d641a20fe27fb790539 Reviewed-on: https://go-review.googlesource.com/16272Reviewed-by: Keith Randall <khr@golang.org>
-
Keith Randall authored
BP for framepointer experiment R15 for dynamic linking Change-Id: I28e48be461d04a4d5c9b013f48fce5c0e58d6a08 Reviewed-on: https://go-review.googlesource.com/16231 Run-TryBot: Todd Neal <todd@tneal.org> Reviewed-by: Todd Neal <todd@tneal.org>
-
- 22 Oct, 2015 1 commit
-
-
Keith Randall authored
Register phis are better than stack phis. If we have unused registers available, use them for phis. Change-Id: I3045711c65caa1b6d0be29131b87b57466320cc2 Reviewed-on: https://go-review.googlesource.com/16080 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
- 20 Oct, 2015 5 commits
-
-
Keith Randall authored
It confuses live variable analysis to have a bunch of unreachable no-ops at the end of a function. Symptom is: gc/plive.go:483 panic: interface conversion: interface {} is nil, not *gc.BasicBlock I don't see any reason why the old compiler needs these no-ops either. all.bash passes with the equivalent code removed on master. Change-Id: Ifcd2c3e139aa16314f08aebc9079b2fb7aa60556 Reviewed-on: https://go-review.googlesource.com/16132Reviewed-by: David Chase <drchase@google.com>
-
Gerrit Code Review authored
-
Keith Randall authored
getg reads from memory, so it should really have a memory arg. It is critical in functions which call setg to make sure getg gets ordered correctly with setg. Change-Id: Ief4875421f741fc49c07b0e1f065ce2535232341 Reviewed-on: https://go-review.googlesource.com/16100 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com>
-
Keith Randall authored
It isn't safe, the place where we're moving the value to might have a different live memory. Moving will introduce two simultaneously live memories. Change-Id: I07e61a6db8ef285088c530dc2e5d5768d27871ff Reviewed-on: https://go-review.googlesource.com/16099Reviewed-by: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com>
-
Keith Randall authored
It isn't safe in functions that also call setg. Change-Id: I76a7bf0401b4b6c8a129c245b15a2d6f06080e94 Reviewed-on: https://go-review.googlesource.com/16095Reviewed-by: Todd Neal <todd@tneal.org>
-
- 19 Oct, 2015 14 commits
-
-
Keith Randall authored
The only major fixup is that duffzero changed from 8-byte writes to 16-byte writes. Change-Id: I1762b74ce67a8e4b81c11568027cdb3572f7f87c
-
David Crawshaw authored
I cannot find any documentation for this, but these tests no longer run on the device I have since upgrading to Android L. Presumably it still works for root, but standard Android programs to not have root access. Change-Id: I001c8fb5ce22f9ff8d7433f881d0dccbf6ab969d Reviewed-on: https://go-review.googlesource.com/16056Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
-
Keith Randall authored
Rematerialize constants instead of spilling and loading them. "Constants" includes constant offsets from SP and SB. Should help somewhat with stack frame sizes. I'm not sure exactly how much yet. Change-Id: I44dbad97aae870cf31cb6e89c92fe4f6a2b9586f Reviewed-on: https://go-review.googlesource.com/16029 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Austin Clements authored
These functions are always called together and perform logically related state resets, so combine them in to just gcResetMarkState. Fixes #11427. Change-Id: I06c17ef65f66186494887a767b3993126955b5fe Reviewed-on: https://go-review.googlesource.com/16041Reviewed-by: Rick Hudson <rlh@golang.org>
-
Austin Clements authored
Currently gcResetGState is called by func gcscan_m for concurrent GC and directly by func gc for STW GC. Simplify this by consolidating these two calls in to one call by func gc above where it splits for concurrent and STW GC. As a consequence, gcResetGState and gcResetMarkState are always called together, so the next commit will consolidate these. Change-Id: Ib62d404c7b32b28f7d3080d26ecf3966cbc4aca0 Reviewed-on: https://go-review.googlesource.com/16040Reviewed-by: Rick Hudson <rlh@golang.org>
-
Austin Clements authored
This work queue is no longer used (there are many reads of work.partial, but the only write is in putpartial, which is never called). Fixes #11922. Change-Id: I08b76c0c02a0867a9cdcb94783e1f7629d44249a Reviewed-on: https://go-review.googlesource.com/15892Reviewed-by: Rick Hudson <rlh@golang.org>
-
Nodir Turakulov authored
fmt docs say: If the operand is a reflect.Value, the concrete value it holds is printed as if it was the operand. It implies recursive application of this rule, which is not the case. Clarify the docs. Change-Id: I019277c7c6439095bab83e5536aa06403638aa51 Reviewed-on: https://go-review.googlesource.com/15952Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
David Crawshaw authored
Also make PIE executables the default build mode, as PIE executables are required as of Android L. For #10807 Change-Id: I86b7556b9792105cd2531df1b8f3c8f7a8c5d25c Reviewed-on: https://go-review.googlesource.com/16055Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org>
-
David Crawshaw authored
For #10807 Change-Id: Ied826d06cb622edf6413b6f2cdcc46987ab0b05a Reviewed-on: https://go-review.googlesource.com/16054Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Fixes #12945. Change-Id: I08b44795fcd7ec59371aea8111f7febead54720b Reviewed-on: https://go-review.googlesource.com/15900Reviewed-by: Robert Griesemer <gri@golang.org>
-
David Crawshaw authored
Change-Id: Ib424e14cfaab35d37ebdd084d41151928bfd645e Reviewed-on: https://go-review.googlesource.com/16051Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org>
-
Brad Fitzpatrick authored
It was generating the wrong error message, always defaulting to "500 Internal Server Error", since the err variable used was always nil. Fixes #12991 Change-Id: I94b0e516409c131ff3b878bcb91e65f0259ff077 Reviewed-on: https://go-review.googlesource.com/16060Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Aaron Jacobs authored
It appears this was made possible by commit 89f185fe; before that, g was not dereferenced above. Change-Id: I70bc571d924b36351392fd4c13d681e938cfb573 Reviewed-on: https://go-review.googlesource.com/16033Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Todd Neal authored
Reuse the ArgSymbol for nodes so that the Aux values will be equal for cse. Change-Id: Iaae80bd19ff2d3f51b6c9049fd860e04baa6f175 Reviewed-on: https://go-review.googlesource.com/15930Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Todd Neal <todd@tneal.org>
-