-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perf: JIT does not optimize pattern "~x + 1" #69003
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
help wanted
[up-for-grabs] Good issue for external contributors
tenet-performance
Performance related issue
Milestone
Comments
GrabYourPitchforks
added
tenet-performance
Performance related issue
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
labels
May 7, 2022
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsBased 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: 7 JIT should be taught to recognize the pattern
|
jakobbotsch
added
the
help wanted
[up-for-grabs] Good issue for external contributors
label
May 9, 2022
JulieLeeMSFT
removed
the
untriaged
New issue has not been triaged by the area owner
label
May 14, 2022
SkiFoD
added a commit
to SkiFoD/runtime
that referenced
this issue
May 20, 2022
SkiFoD
added a commit
to SkiFoD/runtime
that referenced
this issue
May 20, 2022
SkiFoD
added a commit
to SkiFoD/runtime
that referenced
this issue
May 21, 2022
SkiFoD
added a commit
to SkiFoD/runtime
that referenced
this issue
May 23, 2022
jakobbotsch
pushed a commit
that referenced
this issue
Jun 7, 2022
Closed via #69600 |
ghost
locked as resolved and limited conversation to collaborators
Jul 10, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
help wanted
[up-for-grabs] Good issue for external contributors
tenet-performance
Performance related issue
Based on a comment at #68964 (comment).
In main, current JIT compiles this method:
To this in release mode:
JIT should be taught to recognize the pattern
~x + 1
and turn it into a two's-complementneg
instruction.The text was updated successfully, but these errors were encountered: