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

Add support for no_split_stack attribute to LLVM. Use it on main #1226

Closed
brson opened this issue Nov 28, 2011 · 10 comments
Closed

Add support for no_split_stack attribute to LLVM. Use it on main #1226

brson opened this issue Nov 28, 2011 · 10 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@brson
Copy link
Contributor

brson commented Nov 28, 2011

Currently our __morestack method has to do an ugly check to detect whether it is being called from main. gcc supports a no_split_stack attribute that can be used to suppress the split-stack prologue. We should add it to LLVM and use it.

@brson
Copy link
Contributor Author

brson commented Nov 28, 2011

C shim functions run on the C stack so they need to not have the prologue either

@brson
Copy link
Contributor Author

brson commented Mar 6, 2012

Ditto for crust functions.

@brson
Copy link
Contributor Author

brson commented Mar 6, 2012

There was some noise on llvm-dev about this recently but I didn't notice if anything became of it.

@ghost ghost assigned brson Apr 12, 2012
@bblum
Copy link
Contributor

bblum commented Jun 11, 2012

After the changed C stack switching design, it will be essential that C shims have the prologue. Same for crust functions.

My changes to i386 __morestack make the "ugly check" less ugly, but the check could still stand to go away entirely.

@bblum
Copy link
Contributor

bblum commented Jun 21, 2012

C stack switching was dropped; nothing was done about the ugly check.

@brson
Copy link
Contributor Author

brson commented Jan 14, 2013

@amuxtux I'm not clear on the obstacles to implementing __morestack on ARM but I opened an issue about it: #4489. If you intend to disable stack growth on ARM then the easiest way is probably to completely turn off the split stack prologue on ARM (the code for which is here).

@emberian
Copy link
Member

Triage bump; still relevant, esp with recent split-stack discussions.

@brson brson mentioned this issue Jul 28, 2013
4 tasks
@brson
Copy link
Contributor Author

brson commented Jul 28, 2013

This is required for the new scheduler in order to implement split stacks.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Aug 20, 2013
* This has one workaround patch (everything's testing just fine...)
* I reworked the fixedstacksegment attribute to be specified with a string
  rather than using a keyword and an integer and modifying the parser
* I added a "no-split-stack" attribute along the same lines as the
  "fixedstacksegment" attribute for rust-lang#1226
bors added a commit that referenced this issue Aug 20, 2013
The first commit message is pretty good, but whomever reviews this should probably also at least glance at the changes I made in LLVM. I basically reorganized our pending patch queue to be a bit more organized and clearer in what needs to go where. After this, our queue would be:

* Add the `no-split-stack` attribute
* Add the `fixedstacksegment` attribute
* Add split-stacks for arm android
* Add split-stacks for arm linux
* Add split stacks for mips

Then there's a patch which I added to get rust to build at all on LLVM-head, and I'm not quite sure why it's there, but nothing seems to be crashing for now! (famous last words).

Otherwise, I just updated code to reflect the changes I made in LLVM with the only major change being the advent of the new `no_split_stack` attribute. This is work towards #1226, but someone more familiar with the code should probably actually assign the attribute to the appropriate functions.

Also as a bonus, I've verified that this closes #5774
@alexcrichton
Copy link
Member

This attribute has now been implemented in LLVM, and it's available for use via the no_split_stack attribute. Currently there are no users of it, however.

@catamorphism
Copy link
Contributor

Done, closing

bjorn3 added a commit to bjorn3/rust that referenced this issue May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

5 participants