Uh oh!
There was an error while loading. Please reload this page.
JIT: handle some side effects in box pattern match - #1741
Conversation
Handle simple side effects in the `box; br` pattern based optimization. Fixesdotnet#1713.
AndyAyersMS
commented
Jan 15, 2020
cc @dotnet/jit-contrib @jkotas Seems like an important enough case to warrant handling in the jit, despite the small number of impacted methods. Does not hit outside of SPC. TIER0 TIER1 Tried a couple of experiments to mitigate the size regressions, but no luck. They are small. |
jkotas
commented
Jan 15, 2020
What do the size regressions look like? |
AndyAyersMS
commented
Jan 15, 2020
Here is a typical diff, from ;;; before;;; r11 is a span's pointer field, ecx is the span length, r15 the indexG_M45276_IG05:lear14d,[rax+rbp]lear15d,[r14-1]cmpr15d,ecxjae G_M45276_IG13movsxdr15,r15dmovr15, qword ptr [r11+8*r15]cmpr14d,ecxjae G_M45276_IG13movsxdr14,r14dmovr14, qword ptr [r11+8*r14]cmpr15,r14jl SHORT G_M45276_IG08 ;; bbWeight=2 PerfScore 18.50G_M45276_IG06:cmpr15,r14jle SHORT G_M45276_IG09;;; afterG_M45276_IG05:lear14d,[rax+rbp]lear15d,[r14-1]cmpr15d,ecxjae G_M45276_IG13movsxdr15,r15dlear15, bword ptr [r11+8*r15]cmp dword ptr [r15],r15d // residual null checkcmpr14d,ecxjae G_M45276_IG13movsxdr14,r14dmovr14, qword ptr [r11+8*r14]cmp qword ptr [r15],r14jl SHORT G_M45276_IG08 ;; bbWeight=2 PerfScore 23.00G_M45276_IG06:cmp qword ptr [r15],r14jle SHORT G_M45276_IG09Without this change, at Tier1, the So sometimes there's a benefit to a GT_IND based nullcheck, sometimes there's a benefit to GT_NULLCHECK; we can't tell locally which might end up working out better, and we can't normalize to whichever form is better downstream. |
Handle simple side effects in the
box; brpattern based optimization.Fixes#1713.