-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
JIT: (x u>> cns) -> [0..(x's max value >> cns)] #109900
Conversation
Co-authored-by: Theodore Tsirpanis <[email protected]>
PTAL @AndyAyersMS @dotnet/jit-contrib a change to optimize bounds check for "arr[X >> CNS]" pattern in order to remove unsafe code from the repo |
return Range(Limit(Limit::keConstant, 0)); | ||
} | ||
|
||
// Calculate max possible value of op1, e.g. UINT_MAX for TYP_INT/TYP_UINT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was wondering if we could use IntegralRange
here but that seems a bit clunky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, I wanted to call RangeCheck::ComputeRange
on op1 to get even more precise range, but it had no diffs
Optimizes bounds check for #109899