8000 Replace "volatile" MoveRegister instructions with something better · Issue #812 · inko-lang/inko · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
9B3D

Replace "volatile" MoveRegister instructions with something better #812

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

Open
yorickpeterse opened this issue Feb 4, 2025 · 0 comments
Open
Labels
compiler Changes related to the compiler

Comments

@yorickpeterse
Copy link
Collaborator

In MIR the MoveRegister instruction has a volatile field, meant to signal "this move should not be optimized away". It's currently only used when assigning registers that correspond to a local variable.

We could replace this with a SetLocal instruction as this more clearly communicates its intent. In addition, I think this makes it easier to add debug info for local variables at some point in the future. However, since local variables don't really exist at the MIR level this might be a bit odd.

The only place where we read this field is when determining the number of uses of a register, where in case volatile = true we also count the target register. I'm not sure we actually need that or if there's a better approach in the first place.

@yorickpeterse yorickpeterse added the compiler Changes related to the compiler label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Changes related to the compiler
Projects
None yet
Development

No branches or pull requests

1 participant
0