Uh oh!
There was an error while loading. Please reload this page.
JIT: fix range assertions for bypassed phi blocks - #133268
Open
EgorBo wants to merge 1 commit into
Open
Conversation
Fixesdotnet#133267. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 56f763ef-1e54-421c-9e79-fe14ed2b906a
|
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
There was a problem hiding this comment.
🔵 Needs a closer look
It changes JIT range/assertion-merging behavior (compiler correctness surface area), and I did not validate it with local builds/tests in this review.
Pull request overview
This PR updates JIT range-check analysis to avoid relying on potentially stale assertion sets after flow edits (e.g., jump threading bypassing phi-related blocks), and adds a targeted regression test for the reported miscompile scenario.
Changes:
- Adjust range computation for locals so assertion merging happens at the use site (via
MergeAssertion) rather than insideComputeRangeForLocalDef. - Update
ComputeRangeForLocalDefsignature to no longer take the use block. - Add a new JitBlue regression test (
Runtime_133267) and register it inRegression_ro_2.csproj.
File summaries
| File | Description |
|---|---|
| src/coreclr/jit/rangecheck.h | Updates ComputeRangeForLocalDef declaration to drop the BasicBlock* parameter. |
| src/coreclr/jit/rangecheck.cpp | Moves assertion merging responsibility to the local-use path (MergeAssertion) to avoid stale phi-block assertion inputs. |
| src/tests/JIT/Regression/JitBlue/Runtime_133267/Runtime_133267.cs | Adds a regression test that fails if the JIT incorrectly throws ArgumentException under optimization. |
| src/tests/JIT/Regression/Regression_ro_2.csproj | Registers the new regression test for compilation/execution in the ro_2 suite. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
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 freeto 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.
Fixes#133267. Avoid stale phi-block assertions after jump threading.