Skip to content

Conversation

pedrobsaila
Copy link
Contributor

Fixes #119131

@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 Sep 13, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Sep 13, 2025
Comment on lines 7410 to 7411
else if (op1->OperIs(GT_LCL_VAR) &&
(op2->OperIs(GT_LCL_VAR) || (op2->IsIntegralConst() && !op2->IsIntegralConstAbsPow2())))
Copy link
Member

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.

Copy link
Member

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.

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 community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSE seems to fail when writing x / cns and x % cns for unsigned integers

2 participants