-
Notifications
You must be signed in to change notification settings - Fork 5.2k
CSE seems to fail when writing x / cns and x % cns for unsigned integers #119684
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
base: main
Are you sure you want to change the base?
Conversation
src/coreclr/jit/morph.cpp
Outdated
else if (op1->OperIs(GT_LCL_VAR) && | ||
(op2->OperIs(GT_LCL_VAR) || (op2->IsIntegralConst() && !op2->IsIntegralConstAbsPow2()))) |
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.
The comment above this needs to be updated to explain the additional change and why it is beneficial.
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.
I notably would've expected the fix for #119131 to simply check OperIs(GT_MOD, GT_UMOD)
and only the fixes for #117215 or #32615 to be more involved.
If we were to do one of the more involved fixes, I'd likely expect we universally apply this transform and then try to recognize and transform it back later on xarch if other optimizations didn't occur.
Fixes #119131