Repository navigation
JIT: stop inferring through bitwise complement - #133700
Merged
AndyAyersMS merged 1 commit intoSep 11, 2026
Merged
Conversation
Remove the unsound treatment of GT_NOT as logical negation in redundant branch inference. This fixes dotnet#133557. Co-authored-by: Copilot <[email protected]> Copilot-Session: ebb6b542-7cf8-4035-9148-82c31a248fa3
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 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 |
Member
Author
|
@EgorBo PTAL I fixed this in VN a while back, but missed that it was still in RBO. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues were identified.
Pull request overview
This PR fixes unsound JIT inference through bitwise complement and adds regression coverage.
Changes:
- Restricts compound predicate inference to
GT_ANDandGT_OR. - Adds equal/unequal complemented-comparison tests.
File summaries
| File | Description |
|---|---|
src/tests/JIT/opt/RedundantBranch/RedundantBranchSimplify.cs |
Adds regression coverage. |
src/coreclr/jit/redundantbranchopts.cpp |
Removes invalid GT_NOT inference. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
EgorBo
approved these changes
Sep 11, 2026
Member
Author
|
Failures are #133702 |
Member
Author
|
/ba-g known mono test failures, plus build timeouts |
Member
Author
|
no diffs |
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.
Summary
GT_NOTas logical negationFixes #133557.
Validation
python src\coreclr\scripts\jitformat.py -r . -o windows -a x64build.cmd clr.jit -rc CheckedRedundantBranchSimplify.TestComplementedRelop: failed before the fix and passed afterwardRedundantBranchSimplifytests passedRegression history
The underlying issue was introduced by #69291 and first shipped in .NET 7. Optimized IL reproduces on .NET 7 through .NET 11; the exact unoptimized IL shape from #133557 is newly exposed on current main.
Note
This PR description was generated with GitHub Copilot CLI.