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

Resolve aliases before inserting values into the live set #8945

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Jul 12, 2024

This fixes a fuzz bug found in the development of #8941

@fitzgen fitzgen requested review from a team as code owners July 12, 2024 16:58
@fitzgen fitzgen requested review from alexcrichton and abrown and removed request for a team July 12, 2024 16:58
@bjorn3
Copy link
Contributor

bjorn3 commented Jul 12, 2024

Why does the alias resolving need to be done? cranelift-frontend can and does change aliases on the fly. It feels iffy to immediately resolve them inside cranelift-frontend as there is nothing preventing the alias that was resolved to be changed later.

@fitzgen
Copy link
Member Author

fitzgen commented Jul 12, 2024

Why does the alias resolving need to be done?

Because otherwise we would need to have a reverse-aliases map from a value to all of the values that alias it. This is necessary because when we find a definition, we kill it from the live set, so at that point we only have the non-alias value.

It feels iffy to immediately resolve them inside cranelift-frontend as there is nothing preventing the alias that was resolved to be changed later.

Note that the safepoint spilling and its liveness analysis happens as part of finishing a FunctionBuilder, so we don't need to worry about anything changing under our feet here.

@fitzgen fitzgen added this pull request to the merge queue Jul 12, 2024
Merged via the queue into bytecodealliance:main with commit 9f66134 Jul 12, 2024
37 checks passed
@fitzgen fitzgen deleted the fix-fuzz-bug-found-in-8941 branch July 12, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants