Ensure we don't do duplicate checks for various multi-reg paths#128117
Open
tannergooding wants to merge 1 commit into
Open
Ensure we don't do duplicate checks for various multi-reg paths#128117tannergooding wants to merge 1 commit into
tannergooding wants to merge 1 commit into
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
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::GetRegisterDstCountto directly handle known multi-reg shapes (calls, copy/reload, HW intrinsics, multi-reg locals) without a leadingIsMultiRegNode()gate. - Minor cleanup in
GenTree::IsMultiRegNode()to useIsCopyOrReload()instead of opcode checks. - Remove
FEATURE_MULTIREG_RETguards around debug display helpers (gtDispMultiRegCount, multi-reg printing ingtDispRegVal) and the corresponding declaration incompiler.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); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.