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

Build stack allocations at the function entry if possible #48

Open
xermicus opened this issue Sep 16, 2024 · 0 comments
Open

Build stack allocations at the function entry if possible #48

xermicus opened this issue Sep 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@xermicus
Copy link
Member

xermicus commented Sep 16, 2024

Stack allocations built after the first basic block can hurt some performance optimizations. Hypothetically, it should be safe to always insert them there. Practically however it depends on where and how stack allocations are used throughout the translation. Stack allocations can safely be moved to the entry block of our functions iff the program semantics are preserved; which depends on control flow and requires the allocation size to be static.

We should decide for each instance of build_alloca whether it is safe to build them at the function entry and, if appropriate, change them to the fn build_alloca_at_entry helper instead.

@xermicus xermicus added the enhancement New feature or request label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant