-
Notifications
You must be signed in to change notification settings - Fork 5k
JIT: Optimize bit-wise and operation and compare with same constant value #111933
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: Optimize bit-wise and operation and compare with same constant value #111933
Conversation
…alue This change optimizes bit-wise and with compare patterns like '(x & <constant>) == <constant>' Fix dotnet#101000
Thanks for the contribution! I closed/reopened this to kick off a fresh run of the CI. cc @dotnet/jit-contrib |
@@ -4346,6 +4346,16 @@ GenTree* Lowering::OptimizeConstCompare(GenTree* cmp) | |||
} | |||
#endif | |||
} | |||
else if (andOp2->IsIntegralConst() && GenTree::Compare(andOp2, op2)) |
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.
can you leave a comment of what this transformation does?
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 added a comment, hope it's okay.
/azp run Fuzzlyn |
Azure Pipelines successfully started running 1 pipeline(s). |
@EgorBo, please review this community PR again. |
@BruceForstall, please review this community PR. |
/azp run Fuzzlyn, runtime-coreclr outerloop |
Azure Pipelines successfully started running 2 pipeline(s). |
/ba-g unrelated failures |
This pull request resolves #101000 and is based on the feedback that was given on the original PR #103868. Thanks for the previous work, it was a really great way to get started.
The code emitted for:
x64 (before):
x64 (after):
ARM64 (before):
ARM64 (after):