diff options
author | Keith Randall <khr@golang.org> | 2016-09-17 15:04:36 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2016-09-19 02:37:08 +0000 |
commit | 6129f37367686edf7c2732fbb5300d5f28203743 (patch) | |
tree | 18dfa388342ea4868caab33c299be065d558be76 /test/live.go | |
parent | 892d146a7aae17e5fe22e04b16ba4da7e3d8c767 (diff) | |
download | go-6129f37367686edf7c2732fbb5300d5f28203743.tar.gz go-6129f37367686edf7c2732fbb5300d5f28203743.zip |
cmd/compile: inline convT2{I,E} when result doesn't escape
No point in calling a function when we can build the interface
using a known type (or itab) and the address of a local.
Get rid of third arg (preallocated stack space) to convT2{I,E}.
Makes go binary smaller by 0.2%
benchmark old ns/op new ns/op delta
BenchmarkEfaceInteger-8 16.7 10.1 -39.52%
Update #17118
Update #15375
Change-Id: I9724a1f802bfa1e3957bf1856b55558278e198a2
Reviewed-on: https://go-review.googlesource.com/29373
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test/live.go')
-rw-r--r-- | test/live.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/live.go b/test/live.go index dabf82e8f2..2ae8b8f7b6 100644 --- a/test/live.go +++ b/test/live.go @@ -139,7 +139,9 @@ var i9 interface{} func f9() bool { g8() x := i9 - return x != interface{}(99.0i) // ERROR "live at call to convT2E: x.data x.type$" + y := interface{}(99.0i) // ERROR "live at call to convT2E: x.data x.type$" + i9 = y // make y escape so the line above has to call convT2E + return x != y } // liveness formerly confused by UNDEF followed by RET, |