Open EgorBo opened 4 months ago
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.
The existing code works well for static branch prediction: forward branches are statically predicted to fall-through.
The best block re-ordering would be:
sub rsp, 40
mov qword ptr [rsp+0x20], rcx
mov rdx, qword ptr [rcx+0x38]
mov rdx, qword ptr [rdx+0x10]
test rdx, rdx
je SHORT G_M2381_IG04
G_M2381_IG05:
mov rcx, rdx
call [Prog:Bar[System.__Canon]()]
nop
add rsp, 40
ret
G_M2381_IG04:
mov rdx, 0x7FFE1F42D630
call CORINFO_HELP_RUNTIMEHANDLE_METHOD
mov rdx, rax
jmp SHORT G_M2381_IG05
The best block re-ordering would be:
This can be easily done, I just remember we discussed that the helper call path is always invoked at least once so marking it as cold might slightly regress startup
This is the previous discussion for reference: https://github.com/dotnet/runtime/pull/83911#discussion_r1148172248
From: https://github.com/dotnet/runtime/pull/101153
Codegen for
Foo<_Canon>
in Tier1:this block:
seems like it's better to be re-ordered to:
@amanasifkhalid something you might find interesting to take a look since it's block re-ordering. cc @dotnet/jit-contrib