Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: make SSA stack frames smaller #12602

Closed
randall77 opened this issue Sep 13, 2015 · 5 comments
Closed

cmd/compile: make SSA stack frames smaller #12602

randall77 opened this issue Sep 13, 2015 · 5 comments
Milestone

Comments

@randall77
Copy link
Contributor

I had to up the stack guard from 640 to 960 bytes to get SSA + write barriers to work. Look into what grew and why, and fix it.

@josharian @aclements @RLH

@randall77 randall77 added this to the Go1.6 milestone Sep 13, 2015
@aclements
Copy link
Member

When you say "to get them to work", what was it that failed? Did the linker nosplit analysis fail, or was it a failure at run time?

@randall77
Copy link
Contributor Author

The linker nosplit analysis reports an error. Here is one:

syscall.Syscall: nosplit stack overflow
664 assumed on entry to syscall.Syscall (nosplit)
656 on entry to runtime.exitsyscall (nosplit)
552 after runtime.exitsyscall (nosplit) uses 104
544 on entry to runtime.exitsyscallfast (nosplit)
432 after runtime.exitsyscallfast (nosplit) uses 112
424 on entry to runtime.typedmemmove_nostore (nosplit)
408 after runtime.typedmemmove_nostore (nosplit) uses 16
400 on entry to runtime.heapBitsBulkBarrier (nosplit)
128 after runtime.heapBitsBulkBarrier (nosplit) uses 272
120 on entry to runtime.throw (nosplit)
72 after runtime.throw (nosplit) uses 48
64 on entry to runtime.dopanic (nosplit)
-8 after runtime.dopanic (nosplit) uses 72

@bradfitz
Copy link
Contributor

The CL which changed this (https://go-review.googlesource.com/#/c/14530) touched a number of files, including stuff like test/nosplit.go.

(adding this comment to be sure we revert them all)

@gopherbot
Copy link

CL https://golang.org/cl/14758 mentions this issue.

gopherbot pushed a commit that referenced this issue Sep 20, 2015
For variables which get SSA'd, SSA keeps track of all the def/kill.
It is only for on-stack variables that we need them.

This reduces stack frame sizes significantly because often the
only use of a variable was a varkill, and without that last use
the variable doesn't get allocated in the frame at all.

Fixes #12602

Change-Id: I3f00a768aa5ddd8d7772f375b25f846086a3e689
Reviewed-on: https://go-review.googlesource.com/14758
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@aclements
Copy link
Member

(GitHub only closes issues when the commit makes it to master, but this was only on a branch.)

@golang golang locked and limited conversation to collaborators Sep 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants