Ensure we don't do duplicate checks for various multi-reg paths#128117
Ensure we don't do duplicate checks for various multi-reg paths#128117tannergooding wants to merge 1 commit into
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
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). |
|
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. |
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.