Skip to content

JIT: Avoid creating impossible equality assertions #118586

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

Merged
merged 1 commit into from
Aug 11, 2025

Conversation

jakobbotsch
Copy link
Member

Fix #113940

@Copilot Copilot AI review requested due to automatic review settings August 11, 2025 14:54
@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 Aug 11, 2025
Copy link
Contributor

@Copilot 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 fixes issue #113940 by preventing the creation of impossible equality assertions in the JIT compiler's assertion propagation optimization. The fix addresses cases where a small local variable (like byte or short) would be compared to a constant value outside its valid range, which would create impossible assertions that could cause problems elsewhere in the compiler.

  • Adds validation to detect when a truncated constant value differs from the original value for small local variables
  • Avoids creating assertions for impossible equality comparisons that indicate unreachable code
  • Maintains existing behavior for store operations while fixing the issue for other operations

Copy link
Contributor

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

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @EgorBo

@jakobbotsch jakobbotsch requested a review from EgorBo August 11, 2025 14:55
Copy link
Member

@EgorBo EgorBo left a comment

Choose a reason for hiding this comment

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

LGTM

@jakobbotsch
Copy link
Member Author

No diffs

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: Assertion failed 'FitsIn(tree->TypeGet(), value)' during 'Assertion prop'
2 participants