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

YJIT: Avoid reloading InsnOut operands #8021

Merged
merged 1 commit into from Jul 4, 2023
Merged

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Jul 4, 2023

There's this idiom in codegen.rs:

let object_reg = match object {
    Opnd::Reg(_) => object,
    _ => asm.load(object),
};

but Opnd::Reg doesn't seem to be really used in those places. When an argument operand is loaded into a register with asm.load, it's actually Opnd::InsnOut. So this PR fixes the condition to use Opnd::InsnOut instead.

I noticed this when I looked at generated code that contained an identical move mov rax, rax on expandarray. This PR removes such instructions.

@k0kubun k0kubun marked this pull request as ready for review July 4, 2023 00:56
@matzbot matzbot requested a review from a team July 4, 2023 00:56
@maximecb maximecb merged commit 6b2abe5 into ruby:master Jul 4, 2023
89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants