dotnet/runtime

JIT: missing opportunities in constant folding around bitwise ops

開放

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

 (3 則留言) (0 個反應) (0 位負責人)C# (5,445 個分叉)batch import
area-CodeGen-coreclrhelp wantedin-pr

倉庫指標

星標
 (17,886 顆星)
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

貢獻者指南