dotnet/runtime

JIT: missing opportunities in constant folding around bitwise ops

Open

#95 747 ouverte le 7 déc. 2023

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)C# (5 445 forks)batch import
area-CodeGen-coreclrhelp wantedin-pr

Métriques du dépôt

Stars
 (17 886 stars)
Métriques de merge PR
 (Merge moyen 12j 11h) (661 PRs mergées en 30 j)

Description

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

Guide contributeur