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

贡献者指南