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 doubly splitting Opnd::Value on CSel #9617

Merged
merged 1 commit into from Jan 19, 2024

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Jan 19, 2024

Fixes #9599 (comment)

Every Opnd::Value operand is split before insn-specific split here. CSel-specific split could split an Opnd::Value operand again since it's looking at unmapped_opnds[0].

Before

  # Insn: 0001 defined (stack_size: 1)
  # block_given?
  0x55b0bcda705d: mov rax, qword ptr [r13 + 0x20]
  0x55b0bcda7061: mov rax, qword ptr [rax - 8]
  0x55b0bcda7065: test rax, rax
  0x55b0bcda7068: movabs rax, 0x7f9dfee51930
  0x55b0bcda7072: mov rax, rax
  0x55b0bcda7075: mov ecx, 4
  0x55b0bcda707a: cmove rax, rcx
  0x55b0bcda707e: mov rsi, rax

After

  # Insn: 0001 defined (stack_size: 1)
  # block_given?
  0x55a18b4c505d: mov rax, qword ptr [r13 + 0x20]
  0x55a18b4c5061: mov rax, qword ptr [rax - 8]
  0x55a18b4c5065: test rax, rax
  0x55a18b4c5068: movabs rax, 0x7f64811d1950
  0x55a18b4c5072: mov ecx, 4
  0x55a18b4c5077: cmove rax, rcx
  0x55a18b4c507b: mov rsi, rax

@matzbot matzbot requested a review from a team January 19, 2024 19:19
Copy link
Contributor

@maximecb maximecb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing :)

@k0kubun k0kubun merged commit e0f7cee into ruby:master Jan 19, 2024
97 checks passed
@k0kubun k0kubun deleted the yjit-rax branch January 19, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants