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: don't copy args and externs into new stack slots #12070

Closed
josharian opened this issue Aug 7, 2015 · 6 comments
Closed

cmd/compile: don't copy args and externs into new stack slots #12070

josharian opened this issue Aug 7, 2015 · 6 comments
Milestone

Comments

@josharian
Copy link
Contributor

The current regalloc and stackalloc passes copy arguments and globals onto the local stack for use. This is unnecessary; they can be loaded from their original homes as needed.

/cc @randall77

@randall77
Copy link
Contributor

Yes, it is unnecessary for args. It seems necessary for globals unless we have alias information to know otherwise.

@rsc
Copy link
Contributor

rsc commented Aug 10, 2015

Are you talking about SSA? I don't believe that the current compiler copies either into the local stack.

@randall77 randall77 changed the title cmd/compile: don't copy args and externs into new stack slots cmd/compile/ssa: don't copy args and externs into new stack slots Aug 10, 2015
@randall77
Copy link
Contributor

Yes, these are SSA passes.

@rsc
Copy link
Contributor

rsc commented Aug 11, 2015

Thanks. Please do make sure the args are stored back into their original homes when spilled back to the stack. Debugging the runtime and other programs I depend on the stack trace showing the actual current values of the arguments (if they've been reassigned).

@rsc rsc added this to the dev.ssa milestone Oct 23, 2015
@bradfitz bradfitz modified the milestones: dev.ssa, Go1.7 Mar 2, 2016
@ianlancetaylor ianlancetaylor changed the title cmd/compile/ssa: don't copy args and externs into new stack slots cmd/compile: don't copy args and externs into new stack slots May 16, 2016
@rsc
Copy link
Contributor

rsc commented May 17, 2016

I'm a little worried about debuggers but at this point it may be too late for Go 1.7.
@randall77, move to Go 1.8?

@randall77
Copy link
Contributor

This was fixed a while ago, sorry I didn't close the issue.
If args are not modified, they can be reloaded from their original locations.
If args are modified, they are spilled back to their original locations (if they are spilled at all).

@golang golang locked and limited conversation to collaborators May 17, 2017
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

5 participants