mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: layout stack frame during SSA
Identify live stack variables during SSA and compute the stack frame layout earlier so that we can emit instructions with the correct offsets upfront. Passes toolstash/buildall. Change-Id: I191100dba274f1e364a15bdcfdc1d1466cdd1db5 Reviewed-on: https://go-review.googlesource.com/30216 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
f239196b9e
commit
8c24bff52b
17 changed files with 160 additions and 319 deletions
|
|
@ -278,7 +278,8 @@ var passes = [...]pass{
|
|||
{name: "late nilcheck", fn: nilcheckelim2},
|
||||
{name: "flagalloc", fn: flagalloc, required: true}, // allocate flags register
|
||||
{name: "regalloc", fn: regalloc, required: true}, // allocate int & float registers + stack slots
|
||||
{name: "trim", fn: trim}, // remove empty blocks
|
||||
{name: "stackframe", fn: stackframe, required: true},
|
||||
{name: "trim", fn: trim}, // remove empty blocks
|
||||
}
|
||||
|
||||
// Double-check phase ordering constraints.
|
||||
|
|
@ -329,6 +330,8 @@ var passOrder = [...]constraint{
|
|||
{"schedule", "flagalloc"},
|
||||
// regalloc needs flags to be allocated first.
|
||||
{"flagalloc", "regalloc"},
|
||||
// stackframe needs to know about spilled registers.
|
||||
{"regalloc", "stackframe"},
|
||||
// trim needs regalloc to be done first.
|
||||
{"regalloc", "trim"},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue