Skip to content

More precise ranges for casts in GetRangeFromAssertions#124415

Open
EgorBo wants to merge 3 commits intodotnet:mainfrom
EgorBo:precise-cast-ranges
Open

More precise ranges for casts in GetRangeFromAssertions#124415
EgorBo wants to merge 3 commits intodotnet:mainfrom
EgorBo:precise-cast-ranges

Conversation

@EgorBo
Copy link
Member

@EgorBo EgorBo commented Feb 14, 2026

Copilot AI review requested due to automatic review settings February 14, 2026 01:24
@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 Feb 14, 2026
@dotnet-policy-service
Copy link
Contributor

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

Copy link
Contributor

Copilot AI left a 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 improves range analysis in the JIT's range check optimization pass by enabling more precise range propagation through cast operations and adding support for TYP_INT in GetRangeFromType.

Changes:

  • Add early range tightening based on VN type for small types in GetRangeFromAssertions (though this appears to be dead code due to VN normalization)
  • Change cast source type check from exact TYP_INT match to using genActualType, making the code more defensive
  • Add TYP_INT case to GetRangeFromType to return the full int32 range instead of Unknown

Copilot AI review requested due to automatic review settings February 14, 2026 03:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings February 14, 2026 15:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

@EgorBo EgorBo force-pushed the precise-cast-ranges branch from 2704ba3 to e492c87 Compare February 14, 2026 18:54
Copilot AI review requested due to automatic review settings February 14, 2026 18:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@EgorBo EgorBo marked this pull request as ready for review February 14, 2026 21:17
Copilot AI review requested due to automatic review settings February 14, 2026 21:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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.

1 participant