mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] cmd/compile: start arguments as spilled
Declare a function's arguments as having already been spilled so their use just requires a restore. Allow spill locations to be portions of larger objects the stack. Required to load portions of compound input arguments. Rename the memory input to InputMem. Use Arg for the pre-spilled argument values. Change-Id: I8fe2a03ffbba1022d98bfae2052b376b96d32dda Reviewed-on: https://go-review.googlesource.com/16536 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
parent
582baae22a
commit
02f4d0a130
27 changed files with 470 additions and 141 deletions
|
|
@ -759,6 +759,16 @@ func (s *regAllocState) regalloc(f *Func) {
|
|||
pc++
|
||||
continue
|
||||
}
|
||||
if v.Op == OpArg {
|
||||
// Args are "pre-spilled" values. We don't allocate
|
||||
// any register here. We just set up the spill pointer to
|
||||
// point at itself and any later user will restore it to use it.
|
||||
s.values[v.ID].spill = v
|
||||
s.values[v.ID].spillUsed = true // use is guaranteed
|
||||
b.Values = append(b.Values, v)
|
||||
pc++
|
||||
continue
|
||||
}
|
||||
s.clearUses(pc*2 - 1)
|
||||
regspec := opcodeTable[v.Op].reg
|
||||
if regDebug {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue