Repository navigation
arm64: Select REG_ORDER candidates with ordered masks - #136836
jonathandavies-arm wants to merge 2 commits into
Conversation
- Related to dotnet#136694 Use register-mask groups in ARM64 register allocation to preserve the existing register preference order without scanning every candidate's rank. Keep the original scan on other targets and cross-check choices in Checked builds. Against main (b4548da), Release JITs executed 3,999,913,819,224 instructions versus 4,017,017,735,574 on main across seven published Linux ARM64 SuperPMI collections, a 0.426% reduction. SuperPMI asm diffs found no generated code differences among replayed contexts.
|
Azure Pipelines: Successfully started running 6 pipeline(s). 9 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 |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the ARM64 register-selection optimization.
No open issues 🎉
What changed in this PR
This PR reduces ARM64 JIT register-selection work as part of #136694, using ordered register-mask groups to preserve existing register preferences.
Changes:
- Replaces ARM64’s per-candidate rank scan with mask-based selection.
- Retains the rank scan on other targets and cross-checks ARM64 choices in Checked builds.
- Reports a 0.426% instruction-count reduction across seven Linux ARM64 SuperPMI collections, with no generated-code differences in replayed contexts.
| File | Description |
|---|---|
src/coreclr/jit/lsra.cpp |
Adds ARM64 ordered-mask selection to try_REG_ORDER, retaining the fallback scan and Checked-build validation. |
Review effort: Balanced
| // These groups preserve REG_VAR_ORDER and REG_VAR_ORDER_FLT. Select from | ||
| // the first nonempty group instead of visiting every candidate's rank. |
There was a problem hiding this comment.
nit: The float/int tier groupings are hard-coded as raw masks. Please name the source tables in the comment (REG_VAR_ORDER / REG_VAR_ORDER_FLT in targetarm64.h) so anyone editing them knows to update this code. The DEBUG assert will catch a mismatch, but a pointer makes it easier to find.
Change-Id: I36210c8a65045a2fa426619325133ce91a7b31e6
Use register-mask groups in ARM64 register allocation to preserve the existing register preference order without scanning every candidate's rank. Keep the original scan on other targets and cross-check choices in Checked builds.
Against main (b4548da), Release JITs executed 3,999,913,819,224 instructions versus 4,017,017,735,574 on main across seven published Linux ARM64 SuperPMI collections, a 0.426% reduction. SuperPMI asm diffs found no generated code differences among replayed contexts.