dotnet/runtime

JIT: missing opportunities in constant folding around bitwise ops

Open

#95,747 建立於 2023年12月7日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)C# (5,445 fork)batch import
area-CodeGen-coreclrhelp wantedin-pr

倉庫指標

Star
 (17,886 star)
PR 合併指標
 (平均合併 12天 11小時) (30 天內合併 661 個 PR)

描述

int Test(int x, int y) => (x | 5) | (y | 3); // E.g. Enums

Current asm:

; Method Program:Test(int,int):int:this (FullOpts)
       or       edx, 5
       mov      eax, edx
       or       eax, r8d
       or       eax, 3
       ret      
; Total bytes of code: 12

Expected asm:

       mov      eax, edx
       or       eax, r8d
       or       eax, 7
       ret      
; Total bytes of code: 9

貢獻者指南