- 01 Sep, 2015 2 commits
-
-
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 4 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>
-
Todd Neal authored
addEdge had two identical implementations so make it an exported method on Block. Change-Id: I8c21655a9dc5074fefd7f63b2f5b51897571e608 Reviewed-on: https://go-review.googlesource.com/14040Reviewed-by:
Keith Randall <khr@golang.org>
-
Todd Neal authored
Frontend has already rewriten fallthrough statements, we just need to ignore them. Change-Id: Iadf89b06a9f8f9e6e2e1e87c934f31add77a19a1 Reviewed-on: https://go-review.googlesource.com/14029Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
- 28 Aug, 2015 7 commits
-
-
Todd Neal authored
Change-Id: I1453ba226376ccd4d79780fc0686876d6dde01ee Reviewed-on: https://go-review.googlesource.com/14027Reviewed-by:
Keith Randall <khr@golang.org>
-
David Chase authored
Change-Id: I8dee400aef07165f911750de2615b8757f826000 Reviewed-on: https://go-review.googlesource.com/13945Reviewed-by:
Keith Randall <khr@golang.org>
-
Keith Randall authored
Fixes build. There may be no current block. Change-Id: I0da8bab133dc207124556927698e7cd682e64ef5 Reviewed-on: https://go-review.googlesource.com/13989Reviewed-by:
Keith Randall <khr@golang.org>
-
Todd Neal authored
Change-Id: If7a6ab6b1336dbacb006f562be7f153eb93e7253 Reviewed-on: https://go-review.googlesource.com/14025Reviewed-by:
Keith Randall <khr@golang.org>
-
Keith Randall authored
Add a check to make sure value arguments dominate the value. Phi elim output used to fail this test. When eliminating redundant phis, phi elim was using one of the args and not the ultimate source. For example: b1: x = ... -> b2 b3 b2: y = Copy x b3: z = Copy x -> b4 -> b4 b4: w = phi y z Phi elim eliminates w, but it used to replace w with (Copy y). That's bad as b2 does not dominate b4. Instead we should replace w with (Copy x). Fixes #12347 Change-Id: I9f340cdabcda8e2e90359fb4f9250877b1fffe98 Reviewed-on: https://go-review.googlesource.com/13986Reviewed-by:
David Chase <drchase@google.com>
-
David Chase authored
Still to do: arithmetic Change-Id: I31fd23b34980c9ed4b4e304b8597134b2ba6ca5c Reviewed-on: https://go-review.googlesource.com/14024Reviewed-by:
Keith Randall <khr@golang.org>
-
Todd Neal authored
Implement len(map) values. Change-Id: If92be96ec9a7a86aeb3ce566d6758aab01c2fa7d Reviewed-on: https://go-review.googlesource.com/13961Reviewed-by:
Keith Randall <khr@golang.org>
-
- 27 Aug, 2015 2 commits
-
-
Josh Bleecher Snyder authored
Change-Id: I113c07caf504cee66a81730da8830de6de098e49 Reviewed-on: https://go-review.googlesource.com/13981Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
The old backend doesn't like ideal types, and we want to reuse its stackmap generation. OOROR and OANDAND expressions have ideal type. The old backend didn't care, because those expressions got rewritten away into jumps before stackmap generation. Fix the type during conversion. Change-Id: I488e7499298d9aec71da39c202f6a7235935bc8d Reviewed-on: https://go-review.googlesource.com/13980Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 26 Aug, 2015 2 commits
-
-
Todd Neal authored
The code previously always used AX causing errors. For now, just switch off the type in order to at least generate valid code. Change-Id: Iaf13120a24b62456b9b33c04ab31f2d5104b381b Reviewed-on: https://go-review.googlesource.com/13943Reviewed-by:
David Chase <drchase@google.com>
-
Todd Neal authored
Change-Id: Iacd302350cf0a8a8164d937e5c4ac55e6a07d380 Reviewed-on: https://go-review.googlesource.com/13942Reviewed-by:
David Chase <drchase@google.com>
-
- 25 Aug, 2015 16 commits
-
-
Keith Randall authored
Semi-regular merge of master into dev.ssa. Change-Id: Ia7f2e29dfdea7618141efcfcf6f6c7c8b5553dfa
-
Keith Randall authored
Add blocks to remove critical edges, even when it looks like there's no phi that requires it. Regalloc still likes to have critical-edge-free graphs for other reasons. Change-Id: I69f8eaecbc5d79ab9f2a257c2e289d60b18e43c8 Reviewed-on: https://go-review.googlesource.com/13933Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
Ulrich Kunitz authored
The issue 12226 has been caused by the allocation of the same register for the equality check of two byte values. The code in cgen.go freed the register for the second operand before the allocation of the register for the first operand. Fixes #12226 Change-Id: Ie4dc33a488bd48a17f8ae9b497fd63c1ae390555 Reviewed-on: https://go-review.googlesource.com/13771Reviewed-by:
Russ Cox <rsc@golang.org>
-
Keith Randall authored
Change-Id: I3c598faff8af18530ae863b9e72f0cef379b4a1f Reviewed-on: https://go-review.googlesource.com/13909Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Keith Randall authored
Add a new function and generic operation to handle bounds checking for slices. Unlike the index bounds checking the index can be equal to the upper bound. Do gc-friendly slicing that generates proper code for 0-length result slices. This is a takeover of Alexandru's original change, (https://go-review.googlesource.com/#/c/12764/) submittable now that the decompose phase is in. Change-Id: I17d164cf42ed7839f84ca949c6ad3289269c9160 Reviewed-on: https://go-review.googlesource.com/13903Reviewed-by:
David Chase <drchase@google.com>
-
David Chase authored
Basic ops, no particular optimization in the pattern matching yet (e.g. x!=x for Nan detection, x cmp constant, etc.) Change-Id: I0043564081d6dc0eede876c4a9eb3c33cbd1521c Reviewed-on: https://go-review.googlesource.com/13704Reviewed-by:
Keith Randall <khr@golang.org>
-
Austin Clements authored
A comparison of the form l == r where l is an interface and r is concrete performs a type assertion on l to convert it to r's type. However, the compiler fails to zero the temporary where the result of the type assertion is written, so if the type is a pointer type and a stack scan occurs while in the type assertion, it may see an invalid pointer on the stack. Fix this by zeroing the temporary. This is equivalent to the fix for type switches from c4092ac3. Fixes #12253. Change-Id: Iaf205d456b856c056b317b4e888ce892f0c555b9 Reviewed-on: https://go-review.googlesource.com/13872Reviewed-by:
Russ Cox <rsc@golang.org>
-
David Chase authored
Change-Id: I8c17f706a3e0f1fa2d754bfb4ccd1f7a027cb3db Reviewed-on: https://go-review.googlesource.com/13744Reviewed-by:
Keith Randall <khr@golang.org>
-
Keith Randall authored
MOVXload and MOVXstore opcodes have both an auxint offset and an aux offset (a symbol name, like a local or arg or global). Make sure we keep those values during rewrites. Change-Id: Ic9fd61bf295b5d1457784c281079a4fb38f7ad3b Reviewed-on: https://go-review.googlesource.com/13849Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
Dave Cheney authored
Updates #11336 Follow the lead of amd64 by doing a pointer equality check before comparing string/byte contents on arm64. BenchmarkCompareBytesEqual-8 25.8 26.3 +1.94% BenchmarkCompareBytesToNil-8 9.59 9.59 +0.00% BenchmarkCompareBytesEmpty-8 9.59 9.17 -4.38% BenchmarkCompareBytesIdentical-8 26.3 9.17 -65.13% BenchmarkCompareBytesSameLength-8 16.3 16.3 +0.00% BenchmarkCompareBytesDifferentLength-8 16.3 16.3 +0.00% BenchmarkCompareBytesBigUnaligned-8 1132038 1131409 -0.06% BenchmarkCompareBytesBig-8 1126758 1128470 +0.15% BenchmarkCompareBytesBigIdentical-8 1084366 9.17 -100.00% Change-Id: Id7125c31957eff1ddb78897d4511bd50e79af3f7 Reviewed-on: https://go-review.googlesource.com/13885Reviewed-by:
Keith Randall <khr@golang.org>
-
Todd Neal authored
nmspinning has a value range of [0, 2^31-1]. Update the comment to indicate this and fix the comparison so it's not always false. Fixes #11280 Change-Id: Iedaf0654dcba5e2c800645f26b26a1a781ea1991 Reviewed-on: https://go-review.googlesource.com/13877Reviewed-by:
Minux Ma <minux@golang.org>
-
Shenghou Ma authored
gobuf.g is a guintptr, so without hex(), it will be printed as a decimal, which is not very helpful and inconsistent with how other pointers are printed. Change-Id: I7c0432e9709e90a5c3b3e22ce799551a6242d017 Reviewed-on: https://go-review.googlesource.com/13879Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Didier Spezia authored
Simplify slice/map literal expressions. Caught with gofmt -d -s, fixed with gofmt -w -s Reformatted some expressions to improve readability. Change-Id: Iaf123e6bd49162ec45c59297ad3b002ca59443bc Reviewed-on: https://go-review.googlesource.com/13850Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Shenghou Ma authored
While we're at it, also fix a typo. Change-Id: Id436f33cffa5683e2a8450cce5b545960cf2877e Reviewed-on: https://go-review.googlesource.com/13878Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Todd Neal authored
This is not a functional change. nr is a uint64 and can never be less than zero, remove the no-op comparison. Fixes #11279 Change-Id: Iebb36cc8fe97428b503e65d01b5e67d2b2bc7369 Reviewed-on: https://go-review.googlesource.com/13876 Run-TryBot: Todd Neal <todd@tneal.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Aaron Jacobs authored
The nohup command doesn't work in tmux on darwin. Fixes #5135. Change-Id: I1c21073d8bd54b49dd6b0bad86ef088d6d8e7a5f Reviewed-on: https://go-review.googlesource.com/13883Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 24 Aug, 2015 2 commits
-
-
Josh Bleecher Snyder authored
This aids in making sense of the aggregate set of work outstanding. Interest in the details of any particular implementation failure is better handled locally anyway. In my local tree, running make.bash after this CL yields: 14.85% 1811 SSA unimplemented: unhandled expr SLICEARR 13.84% 1687 SSA unimplemented: unhandled expr CALLINTER 11.84% 1444 SSA unimplemented: unhandled stmt RETJMP 10.24% 1249 SSA unimplemented: unhandled expr EFACE 8.52% 1039 SSA unimplemented: unhandled expr SLICE 4.92% 600 SSA unimplemented: local variable with class PAUTO,heap unimplemented 4.90% 598 SSA unimplemented: unhandled expr SLICESTR 3.91% 477 SSA unimplemented: local variable with class PFUNC unimplemented 3.45% 421 SSA unimplemented: not lowered: IMake INTER PTR64 PTR64 3.42% 417 SSA unimplemented: unhandled expr APPEND 3.21% 391 SSA unimplemented: unhandled expr CLOSUREVAR 3.06% 373 SSA unimplemented: unhandled stmt DEFER 3.04% 371 SSA unimplemented: unhandled stmt AS2DOTTYPE 1.61% 196 SSA unimplemented: unhandled expr DOTTYPE 1.56% 190 SSA unimplemented: not lowered: Load STRUCT PTR64 mem 0.79% 96 SSA unimplemented: not lowered: StringMake STRING PTR64 UINTPTR 0.69% 84 SSA unimplemented: unhandled binary op NE FLOAT64 0.53% 65 SSA unimplemented: unhandled expr STRUCTLIT 0.50% 61 SSA unimplemented: not lowered: SliceMake ARRAY PTR64 UINTPTR UINTPTR 0.45% 55 SSA unimplemented: zero for type float64 not implemented 0.44% 54 SSA unimplemented: unhandled addr CLOSUREVAR 0.38% 46 SSA unimplemented: unhandled binary op EQ FLOAT64 0.35% 43 SSA unimplemented: unhandled binary op LT FLOAT64 0.34% 42 SSA unimplemented: unhandled len(map) 0.33% 40 SSA unimplemented: unhandled stmt FALL 0.23% 28 SSA unimplemented: CONVNOP closure 0.21% 25 SSA unimplemented: local variable with class PPARAM,heap unimplemented 0.21% 25 SSA unimplemented: unhandled binary op GT FLOAT64 0.18% 22 SSA unimplemented: unhandled OCONV FLOAT32 -> FLOAT64 0.18% 22 SSA unimplemented: unhandled expr REAL 0.16% 20 SSA unimplemented: unhandled stmt PROC 0.16% 19 SSA unimplemented: unhandled closure arg 0.15% 18 SSA unimplemented: unhandled OCONV INT64 -> FLOAT64 0.12% 15 SSA unimplemented: unhandled expr CFUNC 0.10% 12 SSA unimplemented: unhandled OCONV UINT64 -> FLOAT64 0.09% 11 SSA unimplemented: unhandled OLITERAL 4 0.09% 11 SSA unimplemented: unhandled expr IMAG 0.07% 9 SSA unimplemented: unhandled binary op GE FLOAT64 0.07% 9 SSA unimplemented: unhandled binary op MINUS FLOAT64 0.06% 7 SSA unimplemented: unhandled OCONV FLOAT64 -> FLOAT32 0.06% 7 SSA unimplemented: unhandled binary op NE FLOAT32 0.06% 7 SSA unimplemented: variable address class 5 not implemented 0.05% 6 SSA unimplemented: not lowered: Load COMPLEX128 PTR64 mem 0.05% 6 SSA unimplemented: unhandled expr SLICE3ARR 0.04% 5 SSA unimplemented: unhandled binary op LE FLOAT64 0.03% 4 SSA unimplemented: unhandled OCONV UINTPTR -> FLOAT64 0.03% 4 SSA unimplemented: unhandled binary op EQ COMPLEX128 0.03% 4 SSA unimplemented: unhandled binary op EQ FLOAT32 0.03% 4 SSA unimplemented: unhandled expr COMPLEX 0.02% 3 SSA unimplemented: local variable with class PPARAMOUT,heap unimplemented 0.02% 3 SSA unimplemented: not lowered: Load ARRAY PTR64 mem 0.02% 3 SSA unimplemented: unhandled OCONV INT32 -> FLOAT64 0.02% 3 SSA unimplemented: unhandled OCONV INT64 -> FLOAT32 0.02% 3 SSA unimplemented: unhandled expr SLICE3 0.02% 2 SSA unimplemented: unhandled OCONV COMPLEX64 -> COMPLEX128 0.02% 2 SSA unimplemented: unhandled OCONV FLOAT64 -> INT64 0.02% 2 SSA unimplemented: unhandled OCONV FLOAT64 -> UINT64 0.02% 2 SSA unimplemented: unhandled OCONV INT -> FLOAT64 0.02% 2 SSA unimplemented: unhandled OCONV UINT64 -> FLOAT32 0.02% 2 SSA unimplemented: unhandled binary op EQ COMPLEX64 0.02% 2 SSA unimplemented: unhandled binary op MINUS FLOAT32 0.02% 2 SSA unimplemented: zero for type complex128 not implemented 0.02% 2 SSA unimplemented: zero for type complex64 not implemented 0.02% 2 SSA unimplemented: zero for type float32 not implemented 0.01% 1 SSA unimplemented: not lowered: EqFat BOOL INTER INTER 0.01% 1 SSA unimplemented: not lowered: Store mem UINTPTR COMPLEX128 mem 0.01% 1 SSA unimplemented: unhandled OCONV UINT32 -> FLOAT64 0.01% 1 SSA unimplemented: unhandled cap(chan) 0.01% 1 SSA unimplemented: unhandled expr ARRAYLIT 0.01% 1 SSA unimplemented: unhandled expr PLUS 0.01% 1 SSA unimplemented: unhandled stmt CHECKNIL Change-Id: I43474fe6d6ec22a9f57239090136f6e97eebfdf2 Reviewed-on: https://go-review.googlesource.com/13848Reviewed-by:
Keith Randall <khr@golang.org>
-
Josh Bleecher Snyder authored
This CL takes a simple approach to spilling and loading flags. We never spill. When a load is needed, we recalculate, loading the arguments as needed. This is simple and architecture-independent. It is not very efficient, but as of this CL, there are fewer than 200 flag spills during make.bash. This was tested by manually reverting CLs 13813 and 13843, causing SETcc, MOV, and LEA instructions to clobber flags, which dramatically increases the number of flags spills. With that done, all stdlib tests that used to pass still pass. For future reference, here are some other, more efficient amd64-only schemes that we could adapt in the future if needed. (1) Spill exactly the flags needed. For example, if we know that the flags will be needed by a SETcc or Jcc op later, we could use SETcc to extract just the relevant flag. When needed, we could use TESTB and change the op to JNE/SETNE. (Alternatively, we could leave the op unaltered and prepare an appropriate CMPB instruction to produce the desired flag.) However, this requires separate handling for every instruction that uses the flags register, including (say) SBBQcarrymask. We could enable this on an ad hoc basis for common cases and fall back to recalculation for other cases. (2) Spill all flags with PUSHF and POPF This modifies SP, which the runtime won't like. It also requires coordination with stackalloc to make sure that we have a stack slot ready for use. (3) Spill almost all flags with LAHF, SETO, and SAHF See http://blog.freearrow.com/archives/396 for details. This would handle all the flags we currently use. However, LAHF and SAHF are not universally available and it requires arranging for AX to be free. Change-Id: Ie36600fd8e807ef2bee83e2e2ae3685112a7f276 Reviewed-on: https://go-review.googlesource.com/13844Reviewed-by:
Keith Randall <khr@golang.org>
-