Skip to content

Ensure we don't do duplicate checks for various multi-reg paths#128117

Open
tannergooding wants to merge 1 commit into
dotnet:mainfrom
tannergooding:improve-multi-reg-tp
Open

Ensure we don't do duplicate checks for various multi-reg paths#128117
tannergooding wants to merge 1 commit into
dotnet:mainfrom
tannergooding:improve-multi-reg-tp

Conversation

@tannergooding
Copy link
Copy Markdown
Member

This had a significant improvement to TP for Arm64 in the other PR where I had attempted to ensure other reg state was consistently cloned.

Copilot AI review requested due to automatic review settings May 13, 2026 04:59
@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 May 13, 2026
@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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors multi-reg handling in the JIT GenTree helpers to reduce redundant multi-reg classification checks, and adjusts debug tree-dump helpers to work independent of FEATURE_MULTIREG_RET.

Changes:

  • Refactor GenTree::GetRegisterDstCount to directly handle known multi-reg shapes (calls, copy/reload, HW intrinsics, multi-reg locals) without a leading IsMultiRegNode() gate.
  • Minor cleanup in GenTree::IsMultiRegNode() to use IsCopyOrReload() instead of opcode checks.
  • Remove FEATURE_MULTIREG_RET guards around debug display helpers (gtDispMultiRegCount, multi-reg printing in gtDispRegVal) and the corresponding declaration in compiler.h.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/coreclr/jit/gentree.cpp Refactors multi-reg destination count logic and adjusts debug multi-reg display helpers / guards.
src/coreclr/jit/compiler.h Makes gtDispMultiRegCount always declared in DEBUG builds (no FEATURE_MULTIREG_RET guard).

Comment thread src/coreclr/jit/gentree.cpp
Comment thread src/coreclr/jit/gentree.cpp
@tannergooding tannergooding marked this pull request as ready for review May 13, 2026 12:11
@tannergooding
Copy link
Copy Markdown
Member Author

CC. @dotnet/jit-contrib, @jakobbotsch, @EgorBo. Small cleanup to various key multi-reg paths ensuring we aren't doing an expensive general purpose check and then repeating all the same checks for each path we need to handle.

This provides a good TP improvement for Arm64, giving us -0.32% to 0.09% in MinOpts and -0.08% to -0.02% in FullOpts, with the largest improvements being in the realworld collection.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants