Skip to content

Missed constant folding for some bitwise operations #115199

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

Open
rameel opened this issue Apr 30, 2025 · 2 comments
Open

Missed constant folding for some bitwise operations #115199

rameel opened this issue Apr 30, 2025 · 2 comments
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@rameel
Copy link
Contributor

rameel commented Apr 30, 2025

bool N(int a) => ((a | 2) & 2) == 2;

Asm:

Program:N(int):ubyte (FullOpts):
       or       edi, 2
       test     dil, 2
       setne    al
       movzx    rax, al
       ret      

Expected:

Program:N(int):ubyte (FullOpts):
       mov      eax, 1
       ret      

Examples on Godbolt

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 30, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Apr 30, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@JulieLeeMSFT
Copy link
Member

CC @dotnet/jit-contrib.

@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label May 6, 2025
@JulieLeeMSFT JulieLeeMSFT added this to the Future milestone May 6, 2025
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
Projects
None yet
Development

No branches or pull requests

2 participants