-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Re-order some blocks in runtimelookup #83453
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
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsMotivation: #83430 (comment)
|
if (result == PhaseStatus::MODIFIED_EVERYTHING) | ||
{ | ||
if (opts.OptimizationEnabled()) | ||
{ | ||
fgReorderBlocks(/* useProfileData */ false); | ||
fgUpdateChangedFlowGraph(FlowGraphUpdates::COMPUTE_BASICS); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W.r.t. the confusing diffs, maybe try with this change reverted?
src/coreclr/jit/runtimelookup.cpp
Outdated
nullcheckBb->bbJumpDest = fallbackBb; | ||
fastPathBb->bbJumpDest = block; | ||
nullcheckBb->bbJumpDest = fastPathBb; | ||
fallbackBb->bbJumpDest = block; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you mark fallBackBb->bbSetRunRarely()
? I had to do similar thing to re-arrange in #80297.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
G_M10050_IG01:
sub rsp, 40
;; size=4 bbWeight=1 PerfScore 0.25
G_M10050_IG02:
mov rcx, qword ptr GS:[0x0058]
mov rcx, qword ptr [rcx+30H]
mov edx, dword ptr [rcx+48H]
cmp edx, 2
jl SHORT G_M10050_IG04
;; size=21 bbWeight=1 PerfScore 6.25
G_M10050_IG03:
mov rcx, qword ptr [rcx+50H]
cmp qword ptr [rcx+10H], 0
jne SHORT G_M10050_IG05
;; size=11 bbWeight=0.90 PerfScore 5.42
G_M10050_IG04:
mov rcx, 0xD1FFAB1E
mov edx, 29
mov r8d, 2
call CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED
mov qword ptr [rsp+20H], rax
;; size=31 bbWeight=0.09 PerfScore 0.25
G_M10050_IG05:
mov rax, qword ptr [rsp+20H]
mov eax, dword ptr [rax+8CH]
;; size=11 bbWeight=1 PerfScore 3.00
G_M10050_IG06:
add rsp, 40
ret
;; size=5 bbWeight=1 PerfScore 1.25
vs.
G_M10050_IG01:
sub rsp, 40
;; size=4 bbWeight=1 PerfScore 0.25
G_M10050_IG02:
mov rax, qword ptr GS:[0x0058]
mov rax, qword ptr [rax+30H]
mov ecx, dword ptr [rax+48H]
cmp ecx, 2
jl SHORT G_M10050_IG06
;; size=21 bbWeight=1 PerfScore 6.25
G_M10050_IG03:
mov rax, qword ptr [rax+50H]
cmp qword ptr [rax+10H], 0
je SHORT G_M10050_IG06
;; size=11 bbWeight=0.90 PerfScore 5.42
G_M10050_IG04:
mov r9, qword ptr [rsp+20H]
mov eax, dword ptr [r9+8CH]
;; size=12 bbWeight=1 PerfScore 3.00
G_M10050_IG05:
add rsp, 40
ret
;; size=5 bbWeight=1 PerfScore 1.25
G_M10050_IG06:
mov rcx, 0xD1FFAB1E
mov edx, 29
mov r8d, 2
call CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED
mov r9, rax
mov qword ptr [rsp+20H], r9
jmp SHORT G_M10050_IG04
;; size=36 bbWeight=0 PerfScore 0.00
Motivation: #83430 (comment) let's see the diffs. #83430 changes JIT-EE guid so can't see diffs there