-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIhelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issuePerformance related issue
Milestone
Description
Based on a comment at #68964 (comment).
In main, current JIT compiles this method:
static uint Negate(uint value) => ~value + 1;To this in release mode:
; Method ConsoleApp106.Program:Negate(int):int
G_M48540_IG01:
;; size=0 bbWeight=1 PerfScore 0.00
G_M48540_IG02:
mov eax, ecx
not eax
inc eax
;; size=6 bbWeight=1 PerfScore 0.75
G_M48540_IG03:
ret
;; size=1 bbWeight=1 PerfScore 1.00
; Total bytes of code: 7JIT should be taught to recognize the pattern ~x + 1 and turn it into a two's-complement neg instruction.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIhelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issuePerformance related issue