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

Split large memory accesses in stack alloc #741

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sarranz
Copy link
Collaborator

@sarranz sarranz commented Feb 28, 2024

When stack allocation replaces x = e by [rsp + off] = e, the offset may be too large. I introduced a check at every Copn that splits this memory access into several instructions in ARM. I also added a warning. Note that when x is an array set, this can be fixed manually with reg ptrs, but if it's a variable there's no way of doing so (but this scenario is probably far-fetched).

@eponier
Copy link
Contributor

eponier commented Feb 28, 2024

opam strikes back. You used a feature (symmetry of disequality) that is not available before Coq 8.18 (cf. coq/coq#17025), and opam tests 8.16. The stupid fix is to call a lemma instead of symmetry, but maybe it is time to increase the lowest supported version to 8.18?

@sarranz
Copy link
Collaborator Author

sarranz commented Feb 29, 2024

I will use the lemma, thanks!

@sarranz sarranz force-pushed the stack-alloc-split-mem-op branch from 6f36509 to 8585a1c Compare February 29, 2024 12:26
bgregoir
bgregoir previously approved these changes Mar 13, 2024
Copy link
Contributor

@bgregoir bgregoir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly suspect that we will have to wrote the same code for risc-V.
So maybe we should take the time to make the code a little bit more modular.

@bgregoir bgregoir marked this pull request as draft March 20, 2024 12:11
@vbgl vbgl added the arm Related to the arm port label May 29, 2024
@sarranz sarranz force-pushed the stack-alloc-split-mem-op branch from d6f0923 to 8b37b53 Compare October 7, 2024 21:38
@sarranz sarranz marked this pull request as ready for review October 7, 2024 21:39
@sarranz sarranz force-pushed the stack-alloc-split-mem-op branch from 8b37b53 to 3a4a8b4 Compare October 7, 2024 21:41
@sarranz sarranz force-pushed the stack-alloc-split-mem-op branch from 67d3750 to 4011b7e Compare November 19, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Related to the arm port
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants