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 on lines +898 to +899
assert(!IsMultiRegNode());
return IsValue() ? 1 : 0;
Comment on lines +882 to +889
if (OperIsHWIntrinsic())
{
const NamedIntrinsic intrinsicId = AsHWIntrinsic()->GetHWIntrinsicId();

return HWIntrinsicInfo::GetMultiRegCount(intrinsicId);
if (HWIntrinsicInfo::IsMultiReg(intrinsicId))
{
return HWIntrinsicInfo::GetMultiRegCount(intrinsicId);
}
@tannergooding tannergooding marked this pull request as ready for review May 13, 2026 12:11
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.

2 participants