mirror of
https://github.com/golang/go
synced 2024-10-01 03:18:33 -06:00
cmd/compile/internal/ssagen: call AllocFrame after ssa.Compile
This indirection is no longer necessary. Change-Id: Ibb5eb1753febdc17a93ea9c35130e3d2b26c360e Reviewed-on: https://go-review.googlesource.com/c/go/+/526518 Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
dac9b9ddbd
commit
5d6f835b3e
@ -508,7 +508,6 @@ var passes = [...]pass{
|
||||
{name: "flagalloc", fn: flagalloc, required: true}, // allocate flags register
|
||||
{name: "regalloc", fn: regalloc, required: true}, // allocate int & float registers + stack slots
|
||||
{name: "loop rotate", fn: loopRotate},
|
||||
{name: "stackframe", fn: stackframe, required: true},
|
||||
{name: "trim", fn: trim}, // remove empty blocks
|
||||
}
|
||||
|
||||
@ -577,8 +576,6 @@ var passOrder = [...]constraint{
|
||||
{"flagalloc", "regalloc"},
|
||||
// loopRotate will confuse regalloc.
|
||||
{"regalloc", "loop rotate"},
|
||||
// stackframe needs to know about spilled registers.
|
||||
{"regalloc", "stackframe"},
|
||||
// trim needs regalloc to be done first.
|
||||
{"regalloc", "trim"},
|
||||
// memcombine works better if fuse happens first, to help merge stores.
|
||||
|
@ -154,9 +154,6 @@ type Frontend interface {
|
||||
// for the parts of that compound type.
|
||||
SplitSlot(parent *LocalSlot, suffix string, offset int64, t *types.Type) LocalSlot
|
||||
|
||||
// AllocFrame assigns frame offsets to all live auto variables.
|
||||
AllocFrame(f *Func)
|
||||
|
||||
// Syslook returns a symbol of the runtime function/variable with the
|
||||
// given name.
|
||||
Syslook(string) *obj.LSym
|
||||
|
@ -89,8 +89,6 @@ func (TestFrontend) Auto(pos src.XPos, t *types.Type) *ir.Name {
|
||||
func (d TestFrontend) SplitSlot(parent *LocalSlot, suffix string, offset int64, t *types.Type) LocalSlot {
|
||||
return LocalSlot{N: parent.N, Type: t, Off: offset}
|
||||
}
|
||||
func (TestFrontend) AllocFrame(f *Func) {
|
||||
}
|
||||
func (d TestFrontend) Syslook(s string) *obj.LSym {
|
||||
return d.ctxt.Lookup(s)
|
||||
}
|
||||
|
@ -1,10 +0,0 @@
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ssa
|
||||
|
||||
// stackframe calls back into the frontend to assign frame offsets.
|
||||
func stackframe(f *Func) {
|
||||
f.fe.AllocFrame(f)
|
||||
}
|
@ -566,6 +566,8 @@ func buildssa(fn *ir.Func, worker int) *ssa.Func {
|
||||
// Main call to ssa package to compile function
|
||||
ssa.Compile(s.f)
|
||||
|
||||
fe.AllocFrame(s.f)
|
||||
|
||||
if len(s.openDefers) != 0 {
|
||||
s.emitOpenDeferInfo()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user