]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix late call expansion for SSA-able aggregate results and arguments
authorDavid Chase <drchase@google.com>
Mon, 27 Jul 2020 20:46:35 +0000 (16:46 -0400)
committerDavid Chase <drchase@google.com>
Thu, 1 Oct 2020 16:43:20 +0000 (16:43 +0000)
commitad8447bed94ccb89338b05e7e38f7d53874f0340
tree3a5efe0f708f7501cef13bf5c0581a0c77018d62
parent89f687d6dbc11613f715d1644b4983905293dd33
cmd/compile: fix late call expansion for SSA-able aggregate results and arguments

This change incorporates the decision that it should be possible to
run call expansion relatively late in the optimization chain, so that
(1) calls themselves can be exposed to useful optimizations
(2) the effect of selectors on aggregates is seen at the rewrite,
    so that assignment of parts into registers is less complicated
    (at least I hope it works that way).

That means that selectors feeding into SelectN need to be processed,
and Make* feeding into call parameters need to be processed.

This does however require that call expansion run before decompose
builtins.

This doesn't yet handle rewrites of strings, slices, interfaces,
and complex numbers.

Passes run.bash and race.bash

Change-Id: I71ff23d3c491043beb30e926949970c4f63ef1a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/245133
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/compile.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/expand_calls.go
src/cmd/compile/internal/ssa/writebarrier.go