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

贡献者指南