- 07 Sep, 2015 6 commits
-
-
Todd Neal authored
Be more clear about the two conditions that we care about: 1) a block that performs a nil check (OpIsNonNil), which may be removed 2) a block that is the non-nil sucessor for an OpIsNonNil block Now we only care about removing nilchecks for two scenarios: - a type 1 block is dominated by a type 2 block for the same value - a block is both type 1 and type 2 for the same value Fixes math/big. Change-Id: I50018a4014830461ddfe2a2daf588468e4a8f0b4 Reviewed-on: https://go-review.googlesource.com/14325Reviewed-by:
Keith Randall <khr@golang.org>
-
Josh Bleecher Snyder authored
Now that the standard library tests are all passing, add the test directory tests. These contain a number of edge case tests that are of particular interest for compilers. Some kinds of tests are not well-suited for a new backend, such as errorcheck tests. To start, use SSA only for run and runoutput. There are three failing tests now. Just mark them as such for now, so that we can prevent regressions. This code will all be unwound once SSA codegen matures and becomes the default. Change-Id: Ic51e6d0cc1cd48ef1e2fe2c9a743bf0cce275200 Reviewed-on: https://go-review.googlesource.com/14344Reviewed-by:
Keith Randall <khr@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
Change-Id: I1271c015e602cd7ec92bf24f019dd8839b3180fc Reviewed-on: https://go-review.googlesource.com/14346Reviewed-by:
Keith Randall <khr@golang.org>
-
Josh Bleecher Snyder authored
Change-Id: I17c83f6552367d42d48c1ec62fbb494f010fd866 Reviewed-on: https://go-review.googlesource.com/14343 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by:
David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
Change-Id: I32953c4e1d82795bacba9eb94d65cd2e26bfeb87 Reviewed-on: https://go-review.googlesource.com/14339Reviewed-by:
Keith Randall <khr@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
-
Josh Bleecher Snyder authored
Change-Id: Ifb6b2ad6078ad084b73c0e785e748e92139684e2 Reviewed-on: https://go-review.googlesource.com/14338Reviewed-by:
Keith Randall <khr@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 06 Sep, 2015 4 commits
-
-
Keith Randall authored
They are already handled by the frontend, we just need to skip them when we see them in ssa. Change-Id: I309d91552f96a761f8d429a2cab3a47d200ca9e5 Reviewed-on: https://go-review.googlesource.com/14341Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
CL 14337 made SSA support fixedbugs/issue9604b.go. That test contains > 40k blocks. This made the O(n^2) dom algorithm fail to terminate in a reasonable length of time, breaking the build. For the moment, cap the number of blocks to fix the build. This will be reverted when a more efficient dom algorithm is put in place, which will be soon. Change-Id: Ia66c2629481d29d06655ec54d1deff076b0422c6 Reviewed-on: https://go-review.googlesource.com/14342Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
Josh Bleecher Snyder authored
Change-Id: Iaf282211a717e38b05e5d2661d400d465decad50 Reviewed-on: https://go-review.googlesource.com/14337Reviewed-by:
Keith Randall <khr@golang.org>
-
Keith Randall authored
TODO: for now, just function calls. Do method and interface calls. Change-Id: Ib262dfa31cb753996cde899beaad4dc2e66705ac Reviewed-on: https://go-review.googlesource.com/14035Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
- 05 Sep, 2015 6 commits
-
-
Josh Bleecher Snyder authored
Todd Neal has made all the stdlib tests pass. Now the trybots and build dashboard can help us keep them passing. All of this code will be unwound bit by bit as SSA matures and then becomes the default. Change-Id: I52ac7e72a87d329ccce974d6671c054374828d11 Reviewed-on: https://go-review.googlesource.com/14294Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Keith Randall authored
This change is all about leveraging the gc bitmap generation that is already done by the current compiler. We rearrange how stack allocation is done so that we generate a variable declaration for each spill. We also reorganize how args/locals are recorded during SSA. Then we can use the existing allocauto/defframe to allocate the stack frame and liveness to make the gc bitmaps. With this change, stack copying works correctly and we no longer need hacks in runtime/stack*.go to make tests work. GC is close to working, it just needs write barriers. Change-Id: I990fb4e3fbe98850c6be35c3185a1c85d9e1a6ba Reviewed-on: https://go-review.googlesource.com/13894Reviewed-by:
David Chase <drchase@google.com> Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
David Chase authored
Change to table-driven instead of branchy code; leads to net reduction in lines, easier to understand what happens, easier to modify code if we want option to exclude generation of branchy cases. Doesn't appear to scale for 8x8 case of integer types. Change-Id: Ib40104b149d30bb329c5782f6cac45c75743e768 Reviewed-on: https://go-review.googlesource.com/14163Reviewed-by:
Keith Randall <khr@golang.org>
-
Josh Bleecher Snyder authored
Also, improve HTML formatting. Change-Id: I07e2482a30862e2091707f260a2c43d6e9a85d97 Reviewed-on: https://go-review.googlesource.com/14333Reviewed-by:
Todd Neal <todd@tneal.org>
-
Josh Bleecher Snyder authored
Change-Id: I9c84f5ca18745fb2358494c6944bf7ddd05cf8f0 Reviewed-on: https://go-review.googlesource.com/14332Reviewed-by:
Todd Neal <todd@tneal.org>
-
Todd Neal authored
Rewite user nil checks as OpIsNonNil so our nil check elimination pass can take advantage and remove redundant checks. With make.bash this removes 10% more nilchecks (34110 vs 31088). Change-Id: Ifb01d1b6d2d759f5e2a5aaa0470e1d5a2a680212 Reviewed-on: https://go-review.googlesource.com/14321Reviewed-by:
Keith Randall <khr@golang.org> Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
- 04 Sep, 2015 4 commits
-
-
Keith Randall authored
SSA uses this opcode, the old compiler doesn't. Change-Id: Ic3dde6216496b4b89d570584d34cb0971fdf379d Reviewed-on: https://go-review.googlesource.com/14330Reviewed-by:
Minux Ma <minux@golang.org>
-
Todd Neal authored
Add timing/allocation information to each compiler pass for both the console and html output. Change-Id: I75833003b806a09b4fb1bbf63983258612cdb7b0 Reviewed-on: https://go-review.googlesource.com/14277Reviewed-by:
Keith Randall <khr@golang.org>
-
Todd Neal authored
Store floats in AuxInt to reduce allocations. Change-Id: I101e6322530b4a0b2ea3591593ad022c992e8df8 Reviewed-on: https://go-review.googlesource.com/14320Reviewed-by:
David Chase <drchase@google.com> Reviewed-by:
Keith Randall <khr@golang.org>
-
Todd Neal authored
Store bools in AuxInt to reduce allocations. Change-Id: Ibd26db67fca5e1e2803f53d7ef094897968b704b Reviewed-on: https://go-review.googlesource.com/14276Reviewed-by:
Keith Randall <khr@golang.org>
-
- 03 Sep, 2015 5 commits
-
-
Keith Randall authored
Fallthrough return needs to be a return block before jumping to the exit block. Change-Id: I994de2064da5c326c9cade2c33cbb15bdbce5acb Reviewed-on: https://go-review.googlesource.com/14256Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
Keith Randall authored
It is confusing to have exceptional edges jump back into real code. Distinguish return blocks, which execute acutal code, and the exit block, which is a merge point for the regular and exceptional return flow. Prevent critical edge insertion from adding blocks on edges into the exit block. These added blocks serve no purpose and add a bunch of dead jumps to the assembly output. Furthermore, live variable analysis is confused by these jumps. Change-Id: Ifd69e6c00e90338ed147e7cb351b5100dc0364df Reviewed-on: https://go-review.googlesource.com/14254Reviewed-by:
David Chase <drchase@google.com>
-
Keith Randall authored
Change-Id: I6ea0a3482d8813b8555b16fe6c377cad33554619 Reviewed-on: https://go-review.googlesource.com/14247Reviewed-by:
David Chase <drchase@google.com>
-
Todd Neal authored
cse was incorrectly classifying -0.0 and 0.0 as equivalent. This lead to invalid code as ssa uses PXOR -0.0, reg to negate a floating point. Fixes math. Change-Id: Id7eb10c71749eaed897f29b02c33891cf5820acf Reviewed-on: https://go-review.googlesource.com/14205Reviewed-by:
Keith Randall <khr@golang.org>
-
Todd Neal authored
complex128 was being treated as a complex64 Fixes math/cmplx. Change-Id: I2996915b4cb6b94198d41cf08a30bd8531b9fec5 Reviewed-on: https://go-review.googlesource.com/14206Reviewed-by:
Keith Randall <khr@golang.org>
-
- 02 Sep, 2015 3 commits
-
-
Todd Neal authored
liblink was rewriting xor by a negative zero (used by SSA for negation) as XORPS reg,reg. Fixes strconv. Change-Id: I627a0a7366618e6b07ba8f0ad0db0e102340c5e3 Reviewed-on: https://go-review.googlesource.com/14200Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by:
Keith Randall <khr@golang.org>
-
Todd Neal authored
Modified to use the truncating conversion. Fixes reflect. Change-Id: I47bf3200abc2d2c662939a2a2351e2ff84168f4a Reviewed-on: https://go-review.googlesource.com/14167Reviewed-by:
David Chase <drchase@google.com>
-
Todd Neal authored
It does a XOR internally and clobbers flags. Change-Id: Id6ef9219c4e6c3a2b5fc79c8d52bcfa30c148617 Reviewed-on: https://go-review.googlesource.com/14165Reviewed-by:
Keith Randall <khr@golang.org>
-
- 01 Sep, 2015 5 commits
-
-
Keith Randall authored
They do an AND or an OR internally, so they clobber flags. Fixes #12441 Change-Id: I6c843bd268496bc13fc7e3c561d76619e961e8ad Reviewed-on: https://go-review.googlesource.com/14180Reviewed-by:
Todd Neal <todd@tneal.org>
-
Todd Neal authored
liblink rewrites MOV $0, reg into XOR reg, reg. Make MOVxconst clobber flags so we don't generate invalid code in the unlikely case that it matters. In testing, this change leads to no additional regenerated flags due to a scheduling fix in CL14042. Change-Id: I7bc1cfee94ef83beb2f97c31ec6a97e19872fb89 Reviewed-on: https://go-review.googlesource.com/14043Reviewed-by:
Keith Randall <khr@golang.org>
-
David Chase authored
Still to do: details, more testing corner cases. (e.g. negative zero) Includes small cleanups for previous CL. Note: complex division is currently done in the runtime, so the division code here is apparently not yet necessary and also not tested. Seems likely better to open code division and expose the widening/narrowing to optimization. Complex64 multiplication and division is done in wide format to avoid cancellation errors; for division, this also happens to be compatible with pre-SSA practice (which uses a single complex128 division function). It would-be-nice to widen for complex128 multiplication intermediates as well, but that is trickier to implement without a handy wider-precision format. Change-Id: I595a4300f68868fb7641852a54674c6b2b78855e Reviewed-on: https://go-review.googlesource.com/14028Reviewed-by:
Keith Randall <khr@golang.org>
-
Keith Randall authored
Specifying types in rewrites for all subexpressions gets verbose quickly. Allow opcodes to specify a default type which is used when none is supplied explicitly. Provide default types for a few easy opcodes. There are probably more we can do, but this is a good start. Change-Id: Iedc2a1a423cc3e2d4472640433982f9aa76a9f18 Reviewed-on: https://go-review.googlesource.com/14128Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
Todd Neal authored
Change-Id: Ib0ea4b9c245f3d551e0f703826caa6b444b56a2d Reviewed-on: https://go-review.googlesource.com/14136Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
- 31 Aug, 2015 5 commits
-
-
Todd Neal authored
To reduce the number of spills, give any non-phi values whose argument is the control the same priority as the control. With mask.bash, this reduces regenerated flags from 603 to 240. Change-Id: I26883d69e80357c56b343428fb528102b3f26e7a Reviewed-on: https://go-review.googlesource.com/14042Reviewed-by:
Keith Randall <khr@golang.org>
-
Todd Neal authored
Change-Id: Ic7be8fa3a89e46a93df181df3163ec1bf7e96a23 Reviewed-on: https://go-review.googlesource.com/14076Reviewed-by:
Minux Ma <minux@golang.org>
-
Todd Neal authored
Change-Id: Ice206f7e94af4a148d9dd9a7570f5ed21722bedc Reviewed-on: https://go-review.googlesource.com/14075Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
Todd Neal authored
Change-Id: Ia5483d23fe0b5dd0b6cfe2099e9b475184742716 Reviewed-on: https://go-review.googlesource.com/14074Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
Todd Neal authored
Change-Id: I8fd3727763c812297967c8069847833fc8516ff2 Reviewed-on: https://go-review.googlesource.com/14073Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
- 29 Aug, 2015 2 commits
-
-
Keith Randall authored
Instead of trying to delete dead code as soon as we find it, just mark it as dead using a PlainAndDead block kind. The deadcode pass will do the real removal. This way is somewhat more efficient because we don't need to mess with successor and predecessor lists of all the dead blocks. Fixes #12347 Change-Id: Ia42d6b5f9cdb3215a51737b3eb117c00bd439b13 Reviewed-on: https://go-review.googlesource.com/14033Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
Josh Bleecher Snyder authored
This also fixes the encoding/gob TestTopLevelNilPointer failure. Change-Id: I9b29a6fddffd51af305c685f3a8e2a0594bfeeab Reviewed-on: https://go-review.googlesource.com/14032Reviewed-by:
Keith Randall <khr@golang.org>
-