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>
This commit is contained in:
Keith Randall 2016-09-17 15:04:36 -07:00
parent 892d146a7a
commit 6129f37367
7 changed files with 235 additions and 106 deletions

View file

@ -18,7 +18,7 @@ func makeT() T {
var g T
var sink []byte
var sink interface{}
func TestIssue15854(t *testing.T) {
for i := 0; i < 10000; i++ {