-
Couldn't load subscription status.
- Fork 5.2k
Ignore always-true relops in optRelopTryInferWithOneEqualOperand #117749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 fixes a bug in the JIT compiler's redundant branch optimization where the optimizer incorrectly handled always-true relational operations in optRelopTryInferWithOneEqualOperand. The fix prevents the optimizer from making incorrect inferences when both branches of a dominating relop result in always-true conditions.
- Adds a check to bail out when both branches result in
AlwaysTruestatus - Includes a regression test case that reproduces the original issue
- Improves debug output with additional JITDUMP messages
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/coreclr/jit/redundantbranchopts.cpp | Adds logic to handle always-true relops in both branches and improves debug messaging |
| src/tests/JIT/Regression/JitBlue/Runtime_116159/Runtime_116159.cs | Regression test that reproduces the bug with specific array and relational operations |
| src/tests/JIT/Regression/JitBlue/Runtime_116159/Runtime_116159.csproj | Test project configuration with optimization enabled |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
PTAL @AndyAyersMS @dotnet/jit-contrib No diffs. Apparently, the logic didn't expect both |
|
/ba-g "NetCore-Public 40 timeout" |
Fixes #116159