Skip to content

Ensure that we consistently copy otherRegs#128010

Closed
tannergooding wants to merge 5 commits into
dotnet:mainfrom
tannergooding:fix-clone
Closed

Ensure that we consistently copy otherRegs#128010
tannergooding wants to merge 5 commits into
dotnet:mainfrom
tannergooding:fix-clone

Conversation

@tannergooding
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 10, 2026 18:57
@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 10, 2026
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 extends the JIT’s “copy register assignment” helper logic to more consistently propagate multi-register (“otherRegs”) state across additional node kinds (locals, multireg ops, and JIT intrinsics), and adjusts some multireg handling in register-count/dump code to rely less on FEATURE_MULTIREG_RET compile-time gating.

Changes:

  • Add CopyOtherRegs helpers for GenTreeLclVar, GenTreeMultiRegOp, and GenTreeJitIntrinsic.
  • Update GenTree::CopyReg to copy multireg state for calls, multireg ops (32-bit), copy/reload nodes, HW intrinsics, and multireg locals.
  • Refactor GenTree::GetRegisterDstCount, and make gtDispMultiRegCount / gtDispRegVal available under DEBUG without FEATURE_MULTIREG_RET gating.

Reviewed changes

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

File Description
src/coreclr/jit/gentree.h Adds CopyOtherRegs helpers on several node types to support multireg state propagation.
src/coreclr/jit/gentree.cpp Extends CopyReg logic and refactors GetRegisterDstCount; adjusts debug dump helpers’ feature gating.
src/coreclr/jit/compiler.h Removes FEATURE_MULTIREG_RET gating for gtDispMultiRegCount declaration under DEBUG.

Comment thread src/coreclr/jit/gentree.cpp
Comment thread src/coreclr/jit/gentree.cpp Outdated
Copilot AI review requested due to automatic review settings May 11, 2026 20:59
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@tannergooding tannergooding marked this pull request as ready for review May 11, 2026 23:52
Copilot AI review requested due to automatic review settings May 11, 2026 23:52
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@tannergooding
Copy link
Copy Markdown
Member Author

Talked with @jakobbotsch and they suggested this may not be needed for anything but calls and may not even be needed there (possibly some arm32 weirdness)

so I’m marking back as draft and will update this to avoid it everywhere but calls and assert the data is reg_na instead

@tannergooding tannergooding marked this pull request as ready for review May 13, 2026 04:03
Copilot AI review requested due to automatic review settings May 13, 2026 04:03
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

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

Comment on lines 11262 to +11266
copy->CopyRawCosts(tree);
copy->CopyReg(tree);

assert(tree->GetRegNum() == REG_NA);
assert(tree->GetRegTag() == GenTree::GT_REGTAG_NONE);

Comment on lines +5237 to 5239
assert(exp->GetRegNum() == REG_NA);
assert(exp->GetRegTag() == GenTree::GT_REGTAG_NONE);

@tannergooding
Copy link
Copy Markdown
Member Author

Going to close this. Arm32 is definitely assigning the register state pre-LSRA and so removing this is very non-trivial.

I will extract out the other cleanup I had down to not do repeated IsMultiReg() checks as that had a significant TP improvement for Arm64

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