Repository navigation
Conversation
…ried Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2dce5dc0-e40b-43a6-8407-b9340ddeb589
|
Azure Pipelines: Successfully started running 5 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
@AndyAyersMS @jakobbotsch @dotnet/jit-contrib any ideas if it can be simplified/to be done differently? Diffs imply it's not TP heavy. The change is purely a heuristic so presumably it's not about correctness. Motivation: AI think it's one of the bottlenecks in https://ben-chmarks.com/gemini-neon benchmark (I know it's silly & C# is heavily unsafe there, but we seem to know our cmov+loop is problematic and has to be improved). |
|
@AndyAyersMS @dhartglassMSFT checked the examples from #96380, #96593, and #131714 on x64 and arm64:
Local x64 Release BDN (Ryzen 9 7950X, base -> PR):
|
|
Maybe try those examples both ways, and see which actually performs better? I suspect loop carried will only matter in fairly tight loops? Or have AI create a raft of test cases maybe? |
If-conversion currently bails on any block inside a loop (detected via block weight or reachability). This relaxes it: inside a loop, a
STORE_LCL_VARselect is still converted unless a cheap scan (MayBeLoopCarried) finds that the selected value, or a local computed from it in the following blocks, is either:GT_RETURNselects are always allowed.Benchmarks from https://ben-chmarks.com/gemini-neon (C# solutions, local drivers), ms, base -> diff:
heap (Heap.cs)
union-find
Converting address-feeding selects too gives bigger wins in some cases (e.g. rbtree lookups -25..45%, union-find Set sizes 211 -> 89) but regresses predictable-branch cases such as union-find Balanced merging (145 -> 190), so the heuristic keeps those as branches for now.
SPMI diffs