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

[Bug] Peephole optimization could create unused locals which should be cleaned up #15729

Open
vineethk opened this issue Jan 14, 2025 · 0 comments
Labels
bug Something isn't working compiler-v2

Comments

@vineethk
Copy link
Contributor

🐛 Bug

When peephole optimization runs, it can end up deleting instructions. If StLoc instructions are deleted, the locals that they used to refer to may no longer have references in the code, but we may still retain the original slots for those unused locals.

We should do a pass over the generated code (after peephole optimization), and if any local does not have a corresponding (one or more) StLoc instruction, then the local should be eliminated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler-v2
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant