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: Merge csel and mov on arm64 #7747

Merged
merged 2 commits into from Apr 20, 2023
Merged

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Apr 20, 2023

This PR merges csel and mov on arm64 when the mov is just moving the InsnOut of csel to another register. The first commit does refactoring that is useful for this change, and the second commit does the optimization.

I don't see a significant impact on benchmarks, but this should help the stack temp register allocation performance #7659.

Example

before

  # Insn: 0003 opt_lt (stack_size: 2)
  0x110000098: cmp x1, x9
  0x11000009c: mov x11, #0x14
  0x1100000a0: mov x12, #0
  0x1100000a4: csel x11, x11, x12, lt
  0x1100000a8: mov x1, x11

after

  # Insn: 0003 opt_lt (stack_size: 2)
  0x104720098: cmp x1, x9
  0x10472009c: mov x11, #0x14
  0x1047200a0: mov x12, #0
  0x1047200a4: csel x1, x11, x12, lt

@k0kubun k0kubun marked this pull request as ready for review April 20, 2023 18:37
@matzbot matzbot requested a review from a team April 20, 2023 18:37
@k0kubun k0kubun merged commit 64a2597 into ruby:master Apr 20, 2023
99 checks passed
@k0kubun k0kubun deleted the yjit-arm64-csel branch April 20, 2023 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants