JIT: fold trivial redundant comparisons on loop induction variables#130205
JIT: fold trivial redundant comparisons on loop induction variables#130205EgorBo wants to merge 2 commits into
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
This PR adjusts assertion propagation’s SSA-based range query budget so that RangeCheck::TryGetRange can successfully compute ranges for common loop induction-variable patterns, enabling folding of trivially redundant comparisons.
Changes:
- Increase the default SSA walk budget used by
assertionprop’s slowGetRangepath from 64 to 256. - Add an explanatory comment describing why
TryGetRangeneeds a larger shared budget due to multiple internal SSA walks.
|
@MihuBot -nuget |
f3f6bfd to
a45588c
Compare
|
PTAL @dotnet/jit-contrib simple change, just bumped the budget. |
|
SPMI diffs look good mostly, but LoopsIVWidened metric diff shows +0.06% to +10.23%. Is it expected? |
That means more loops are IV widened. We generally don't pay attention to metrics unless we want to track something, so the numbers for metrics don't generally say that something improved/regressed. |
Closes #130206
G_M24707_IG02: xor ebx, ebx mov rsi, 0x... ; 'Hi' - jmp SHORT G_M24707_IG05 -G_M24707_IG03: - inc ebx -G_M24707_IG04: - test ebx, ebx - jl SHORT G_M24707_IG03 -G_M24707_IG05: +G_M24707_IG03: mov rcx, rsi call [System.Console:WriteLine(System.String)] inc ebx cmp ebx, 100 - jl SHORT G_M24707_IG04 + jl SHORT G_M24707_IG03Some nice diffs, mostly in tests, though.