]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: rework/reduce partially lived argument spilling
authorCherry Zhang <cherryyz@google.com>
Sun, 11 Apr 2021 16:42:49 +0000 (12:42 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 14 Apr 2021 21:00:20 +0000 (21:00 +0000)
commit23f8c203f026814ddc4ba4538f900d8151eb6840
tree2aa865117c54427b314177f604b6dba44a26c6fc
parent1a8f0a79619bee4b0040888a5703e38f8117d682
cmd/compile: rework/reduce partially lived argument spilling

In CL 307909 we generate code that spills pointer-typed argument
registers if it is part of an SSA-able aggregate. The current
code spill the register unconditionally. Sometimes it is
unnecessary, because it is already spilled, or it is never live.

This CL reworks the spill generation. We move it to the end of
compilation, after liveness analysis, so we have information about
if a spill is necessary, and only generate spills for the
necessary ones.

Change-Id: I8d60be9b2c47651aeda14f5e2d1bbd207c134b26
Reviewed-on: https://go-review.googlesource.com/c/go/+/309331
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/amd64/galign.go
src/cmd/compile/internal/amd64/ssa.go
src/cmd/compile/internal/liveness/plive.go
src/cmd/compile/internal/ssagen/arch.go
src/cmd/compile/internal/ssagen/ssa.go