]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/ssagen: call AllocFrame after ssa.Compile
authorMatthew Dempsky <mdempsky@google.com>
Thu, 7 Sep 2023 05:33:24 +0000 (22:33 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 8 Sep 2023 19:05:18 +0000 (19:05 +0000)
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>
src/cmd/compile/internal/ssa/compile.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/export_test.go
src/cmd/compile/internal/ssa/stackframe.go [deleted file]
src/cmd/compile/internal/ssagen/ssa.go

index 8618cf34cdf2d645195dc5de7a030d7f933ca1dd..10984d508be4f30218cf400804a85bb8ea4f6453 100644 (file)
@@ -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.
index f50c96228e5f33e43c220c4dee3fa8c686fda846..4dcb57c2f9362d857f7c074aadea86b9ca59f7d1 100644 (file)
@@ -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
index 45a8f8b9e23cf99f86d4ecb368ca6ad09d8b5dac..e2a600a201c9f8dc26ce3cd48476760d7bc222a1 100644 (file)
@@ -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)
 }
diff --git a/src/cmd/compile/internal/ssa/stackframe.go b/src/cmd/compile/internal/ssa/stackframe.go
deleted file mode 100644 (file)
index 08be62a..0000000
+++ /dev/null
@@ -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)
-}
index d1f0fe53310812712314fdf30c028e85257783d8..8a8a2eb1044238d5ec8146678b81ec2d09115249 100644 (file)
@@ -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()
        }