]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: improve walkReturn common case
authorMatthew Dempsky <mdempsky@google.com>
Sun, 3 Jan 2021 07:56:20 +0000 (23:56 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Sun, 3 Jan 2021 19:48:15 +0000 (19:48 +0000)
commitd36a6bf44da6d9b6e1ec355381ef15d253435e20
tree59352e87c747ae2298d0be57d134a7d8f54f9f0e
parenta317067d65c2f9814cb05e573974d416949bace8
[dev.regabi] cmd/compile: improve walkReturn common case

Instead of evaluating all result expressions up front and then
assigning them to their result destinations, we can interleave
evaluation with assignment. This reduces how much temporary
stack/register space is needed to hold the values in flight.

Doesn't pass toolstash -cmp, because it allows better return statement
code to be generated. E.g., cmd/go's text segment on linux/ppc64le
shrinks another 1kB.

Change-Id: I3fe889342c80e947e0118704ec01f1682c577e6e
Reviewed-on: https://go-review.googlesource.com/c/go/+/281153
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/walk/assign.go