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

Appropriately zero extend registers when a guard fails. #1595

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

ltratt
Copy link
Contributor

@ltratt ltratt commented Feb 9, 2025

Previously we handed registers back to AOT with possibly undefined upper bits. As far as we can tell so far, LLVM expects registers to be zero extended [that said, I must admit that I expect that in some cases they should be sign extended, but that's not something I'm sure about].

This commit has the register allocator return a GuardSnapshot at each guard in a trace, where we work out what registers would need to be zero extended if that guard fails. When we generate the "get ready for deopt" code, we pass that GuardSnapshot back to the register allocator, which generates the necessary zero extension code.

Previously we handed registers back to AOT with possibly undefined upper
bits. As far as we can tell so far, LLVM expects registers to be zero
extended [that said, I must admit that I expect that in some cases they
should be sign extended, but that's not something I'm sure about].

This commit has the register allocator return a `GuardSnapshot` at each
guard in a trace, where we work out what registers would need to be zero
extended if that guard fails. When we generate the "get ready for deopt"
code, we pass that `GuardSnapshot` back to the register allocator, which
generates the necessary zero extension code.
@ltratt ltratt marked this pull request as ready for review February 9, 2025 09:04
@vext01 vext01 added this pull request to the merge queue Feb 10, 2025
Merged via the queue into ykjit:master with commit c3537dd Feb 10, 2025
2 checks passed
@ltratt ltratt deleted the zero_extend_for_deopt branch February 10, 2025 11:18
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