Skip to content

arm64: Select REG_ORDER candidates with ordered masks - #136836

Merged
dhartglassMSFT merged 3 commits into
dotnet:mainfrom
jonathandavies-arm:upstream/opt/arm64-register-order-masks
Nov 12, 2026
Merged

dhartglassMSFT merged 3 commits into
dotnet:mainfrom
jonathandavies-arm:upstream/opt/arm64-register-order-masks

Conversation

@jonathandavies-arm

Copy link
Copy Markdown
Contributor

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.

- 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.
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 2, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 2, 2026
@azure-pipelines

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

Comment thread src/coreclr/jit/lsra.cpp Resolved
Change-Id: I36210c8a65045a2fa426619325133ce91a7b31e6
@dhartglassMSFT
dhartglassMSFT enabled auto-merge (squash) November 12, 2026 00:07
@dhartglassMSFT
dhartglassMSFT merged commit 49abd94 into dotnet:main Nov 12, 2026
133 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants