CSE CQ issue
- 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
Assessment
This issue has not been assessed yet.