Repository navigation
JIT: support register-condition SELECT_INC/NEG/INV on arm64 - #135596
Merged
Merged
Conversation
When a SELECT keeps a register condition (e.g. a CCMP chain too long for TryLowerConditionToFlagsNode), lowering may still turn it into GT_SELECT_INC/NEG/INV, but LSRA, VisitOperands and codegen (for INC) did not handle these nodes. Also keep the smaller constant as the CINC base in TryLowerCnsIntCselToCinc for GT_SELECT, as done for GT_SELECTCC. Fixes dotnet#134055 Fixes dotnet#134056 Co-authored-by: Copilot <[email protected]>
|
Azure Pipelines: Successfully started running 7 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The backend changes consistently handle all affected operands, and focused tests cover both condition outcomes and specialized forms.
0 open findings
What changed in this PR
Fixes Arm64 JIT handling of register-conditioned specialized select nodes, preventing LSRA failures and incorrect code generation.
Changes:
- Adds operand and LSRA support for
SELECT_INC/NEG/INV. - Corrects
CINCbase selection and condition consumption. - Adds regression coverage for all affected forms.
| File | Description |
|---|---|
src/coreclr/jit/codegenarm64.cpp |
Consumes register conditions for SELECT_INC. |
src/coreclr/jit/compiler.hpp |
Visits operands of specialized selects. |
src/coreclr/jit/lowerarmarch.cpp |
Keeps the smaller constant as the CINC base. |
src/coreclr/jit/lsraarm64.cpp |
Routes specialized selects through BuildSelect. |
src/coreclr/jit/lsraarmarch.cpp |
Builds condition and value operand uses. |
src/tests/JIT/Regression_ro_2/Runtime_134055.cs |
Covers register-conditioned increment, negate, and invert selects. |
🧠 Review effort: Balanced
Member
Author
|
PTAL @dotnet/jit-contrib, simple bug-fix, no diffs |
Member
Author
|
PTAL @adamperlin |
JulieLeeMSFT
approved these changes
Oct 13, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When a SELECT keeps a register condition (e.g. a CCMP chain too long for TryLowerConditionToFlagsNode), lowering may still turn it into GT_SELECT_INC/NEG/INV, but LSRA, VisitOperands and codegen (for INC) did not handle these nodes. Also keep the smaller constant as the CINC base in TryLowerCnsIntCselToCinc for GT_SELECT, as done for GT_SELECTCC.
Fixes #134055
Fixes #134056
No diffs