JIT: Optimize bit-wise and operation and compare with same constant value#111933
Merged
BruceForstall merged 6 commits intodotnet:mainfrom Apr 23, 2025
Conversation
…alue This change optimizes bit-wise and with compare patterns like '(x & <constant>) == <constant>' Fix dotnet#101000
Member
|
Thanks for the contribution! I closed/reopened this to kick off a fresh run of the CI. cc @dotnet/jit-contrib |
EgorBo
reviewed
Feb 24, 2025
| } | ||
| #endif | ||
| } | ||
| else if (andOp2->IsIntegralConst() && GenTree::Compare(andOp2, op2)) |
Member
There was a problem hiding this comment.
can you leave a comment of what this transformation does?
Contributor
Author
There was a problem hiding this comment.
I added a comment, hope it's okay.
This was referenced Feb 24, 2025
Member
|
/azp run Fuzzlyn |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
|
@EgorBo, please review this community PR again. |
Member
|
@BruceForstall, please review this community PR. |
Contributor
|
/azp run Fuzzlyn, runtime-coreclr outerloop |
BruceForstall
approved these changes
Apr 21, 2025
|
Azure Pipelines successfully started running 2 pipeline(s). |
Contributor
|
/ba-g unrelated failures |
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 free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 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):