dotnet / dotnet/runtime

CSE CQ issue

Open
#123,301 3 comments 0 reactions 0 assignees View on GitHub
area-CodeGen-coreclr
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

Found in "improvements" in https://github.com/dotnet/runtime/pull/123290

```cs
private int _flags;
public void SetFlags(int value)
{
_flags &= 0x00000EF0;
_flags |= (value);
}
```
Currently emits:
```asm
mov eax, dword ptr [rcx+0x08]
and eax, 0xEF0
mov dword ptr [rcx+0x08], eax
or eax, edx
mov dword ptr [rcx+0x08], eax
ret
```
Expected codegen (or when CSE phase is disabled):
```asm
and dword ptr [rcx+0x08], 0xEF0
or dword ptr [rcx+0x08], edx
ret
```
Win-x64. Seems to be an unfortunate CSE decision (or maybe some downstream phase should handle it).
cc @dotnet/jit-contrib

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.