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

Insert assignments in JuvixReg to guarantee continuous memory use #2576

Closed
lukaszcz opened this issue Jan 11, 2024 · 0 comments · Fixed by #2650
Closed

Insert assignments in JuvixReg to guarantee continuous memory use #2576

lukaszcz opened this issue Jan 11, 2024 · 0 comments · Fixed by #2650
Assignees
Milestone

Comments

@lukaszcz
Copy link
Collaborator

lukaszcz commented Jan 11, 2024

Cairo requires memory to be used continuously, e.g., one cannot assign to memory at address 100 and leave memory at address 99 uninitialized at the end of the program (this is checked by the Cairo runner). Hence, we cannot leave any temporary variables in JuvixReg uninitialized. We need to implement a transformation on JuvixReg that initializes variables not assigned in an if/case branch, but assigned in other branches (variables assigned in only one branch will appear e.g. as a result of transforming JuvixReg into SSA form).

@lukaszcz lukaszcz added this to the 0.6.0 milestone Jan 11, 2024
@lukaszcz lukaszcz self-assigned this Jan 11, 2024
paulcadman pushed a commit that referenced this issue Feb 23, 2024
…hes (#2650)

* Closes #2576 
* Adds a JuvixReg transformation `InitBranchVars` which inserts
assignments to initialize variables assigned in other branches. Assumes
the input is in SSA form (which is preserved).
* Adds tests for the `InitBranchVars` transformation.
* Depends on #2647
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant