Skip to content

ZJIT: Remove no-op movs after register allocation #13954

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
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

XrXr
Copy link
Member

@XrXr XrXr commented Jul 18, 2025

Previously `no_dead_mov_from_vreg` generated:

    0x0: ldur x0, [x0]
    0x4: mov x0, x0
    0x8: ret

Because of phase ordering. Split couldn't recognize that the no-op mov
because at that point it sees a `VReg`.

Re the capstone change, it seems fairly easy to fix upstream. I'll try and toss
them a PR.
capstone-rust/capstone-rs#184

XrXr added 2 commits July 18, 2025 15:37
It has a bad habit of leaving a trailing space, for example for ARM
`ret`.
Previously `no_dead_mov_from_vreg` generated:

    0x0: ldur x0, [x0]
    0x4: mov x0, x0
    0x8: ret

Because of phase ordering. Split couldn't recognize that the no-op mov
because at that point it sees a `VReg`.
@matzbot matzbot requested a review from a team July 18, 2025 19:42
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.

2 participants