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

Consider an aliasing restriction to make mem2reg easier #6069

Open
jfecher opened this issue Sep 17, 2024 · 2 comments
Open

Consider an aliasing restriction to make mem2reg easier #6069

jfecher opened this issue Sep 17, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@jfecher
Copy link
Contributor

jfecher commented Sep 17, 2024

Problem

Mem2reg is now the most complex SSA pass and has a large surface area for miscompilation bugs.

Happy Case

Mem2reg could be simplified if we can assume that aliases to a reference cannot be used while another is "active" / borrowed. This would be similar to rust's aliasability xor mutability rule. We should consider this as an option since aliasing mutable references is rare in practice.

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@jfecher jfecher added the enhancement New feature or request label Sep 17, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Sep 17, 2024
@jfecher
Copy link
Contributor Author

jfecher commented Sep 19, 2024

The downside of this is that it'd require we implement a borrow checker

@sirasistant
Copy link
Contributor

Would this be connected with having ownership semantics instead of immutability or is it a completely separate problem space?

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
Status: 📋 Backlog
Development

No branches or pull requests

2 participants