You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adjusts JIT range inference to better reason about VNF_Cast in RangeCheck::GetRangeFromAssertionsWorker, and updates value-number constant extraction to use a 64-bit intermediate when checking whether an integral VN constant fits in a requested target type.
Changes:
ValueNumStore::IsVNIntegralConstant now coerces constants to int64_t before applying FitsIn<T>, avoiding width-related truncation issues.
GetRangeFromAssertionsWorker refines how it selects an initial range for VNF_Cast by distinguishing widening vs. narrowing/same-size casts.
GetRangeFromAssertionsWorker adds an IsVNConstant fast-path for constants (but currently risks returning a non-constant range in a code path that is expected to produce constant ranges).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File
Description
src/coreclr/jit/valuenum.h
Uses a 64-bit coerced constant (int64_t) when probing whether an integral VN constant fits in a requested type.
src/coreclr/jit/rangecheck.cpp
Improves VNF_Cast range selection (widening vs. narrowing) and adjusts constant handling in GetRangeFromAssertionsWorker.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
2 participants
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.
This is a smaller change from #128906 that doesn't involve more complex handling around
TYP_LONG