-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[JIT]: Codegen for manual devirtualization #60492
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
untriaged
New issue has not been triaged by the area owner
Comments
dotnet-issue-labeler
bot
added
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
untriaged
New issue has not been triaged by the area owner
labels
Oct 15, 2021
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsThis code (sharlab).. public T WithManualDevirt(int index)
{
var listStore = _listStore;
if (listStore is SingleItemList<T> singleItem)
return singleItem.EntryAt(index);
return listStore.EntryAt(index);
} generates the following assembly: mov rcx, [rcx+8]
mov rax, rcx
test rax, rax
je short L001d
mov r8, 0x7fff4a8ad9c0
cmp [rax], r8
je short L001d
xor eax, eax
L001d: test rax, rax
je short L0026
mov eax, [rax+8]
ret
L0026: mov rax, [rcx]
mov rax, [rax+0x40]
mov rax, [rax+0x20]
jmp rax I think it could be simpler, with less tests and jumps mov rcx, [rcx+8]
mov rax, rcx
test rax, rax
je short L0026
mov r8, 0x7fff4a8ad9c0
cmp [rax], r8
jne short L0026
mov eax, [rax+8]
ret
L0026: mov rax, [rcx]
mov rax, [rax+0x40]
mov rax, [rax+0x20]
jmp rax sharplab is now on 5.0, but 6.0 rc2 generates the same code.
|
Thanks for reminding me this issue! But I think we can close it as dup of #36649 |
ghost
locked as resolved and limited conversation to collaborators
Nov 15, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
untriaged
New issue has not been triaged by the area owner
This code (sharplab)..
generates the following assembly:
I think it could be simpler, with less tests and jumps
sharplab is now on 5.0, but 6.0 rc2 generates the same code.
The text was updated successfully, but these errors were encountered: