Skip to content

JIT: Properly handle unknown starting values for overflow checks in SCEV analysis - #133766

Merged
jakobbotsch merged 3 commits into
mainfrom
copilot/fix-jit-bug-strength-reduction
Sep 16, 2026
Merged

jakobbotsch merged 3 commits into
mainfrom
copilot/fix-jit-bug-strength-reduction

Conversation

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown
Contributor
  • Inspect AddRec overflow handling and nearby JIT regression-test patterns
  • Add the targeted regression test and correct symbolic-start overflow detection
  • Build and run focused validation, format JIT changes, and scan for secrets
  • Review, validate, and publish the minimal change

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 11, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
Copilot stopped work on behalf of jakobbotsch due to an error September 12, 2026 00:31
Copilot AI requested a review from jakobbotsch September 12, 2026 00:31
@jakobbotsch

Copy link
Copy Markdown
Member

@copilot Please add the test as a single .cs file under src/tests/JIT/Regression_ro_2

Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>

Copilot AI commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please add the test as a single .cs file under src/tests/JIT/Regression_ro_2

Addressed in 01f5fb91: the regression test is now the single file src/tests/JIT/Regression_ro_2/Runtime_133759.cs.

@jakobbotsch
jakobbotsch marked this pull request as ready for review September 14, 2026 12:44
Copilot AI lite review requested due to automatic review settings September 14, 2026 12:44
@azure-pipelines

Copy link
Copy Markdown
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The targeted fix and regression coverage address the reported issue with no unresolved blocking concerns.

Pull request overview

Fixes a RyuJIT overflow-analysis bug that could produce incorrect strength-reduced values for symbolic recurrence starts.

Changes:

  • Conservatively reject unsafe extension distribution for unknown or nonzero starts.
  • Add regression coverage for signed-to-unsigned wraparound.
File summaries
File Summary
src/coreclr/jit/scev.cpp Corrects symbolic-start overflow detection.
src/tests/JIT/Regression_ro_2/Runtime_133759.cs Adds targeted regression coverage.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

@jakobbotsch

Copy link
Copy Markdown
Member

cc @dotnet/jit-contrib PTAL @EgorBo, a silly logic bug

One diff in a test

@jakobbotsch
jakobbotsch requested a review from EgorBo September 16, 2026 07:49
@jakobbotsch

Copy link
Copy Markdown
Member

/ba-g Failure is the one fixed by #133775

@jakobbotsch
jakobbotsch merged commit f92f939 into main Sep 16, 2026
141 of 144 checks passed
@jakobbotsch
jakobbotsch deleted the copilot/fix-jit-bug-strength-reduction branch September 16, 2026 10:54
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 17, 2026
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 18, 2026
…CEV analysis (dotnet#133766)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT: (bug) Strength reduction produces wrong values: AddRecMayOverflow treats a non-constant add-recurrence start as zero

4 participants