-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Open
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 SuperPMIgood first issueIssue should be easy to implement, good for first-time contributorsIssue should be easy to implement, good for first-time contributorshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors
Milestone
Description
Noted in discussion here about the recent DateTime perf optimization, that we could not rely on the JIT to safely collapse multiplication. In this example below, there's an extra shr. Same on x86.
class Program
{
uint f(uint u2) {
return u2 / 2939745 / 4;
}
uint g(uint u2) {
return u2 / 11758980;
}
}Program.f(UInt32)
L0000: mov eax, edx
L0002: imul rax, 0x5b4fffcb
L0009: shr rax, 0x34
L000d: shr eax, 2
L0010: ret
Program.g(UInt32)
L0000: mov eax, edx
L0002: imul rax, 0x5b4fffcb
L0009: shr rax, 0x36
L000d: retcc @cassioneri
category:cq
theme:basic-cq
skill-level:beginner
cost:small
impact:small
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 SuperPMIgood first issueIssue should be easy to implement, good for first-time contributorsIssue should be easy to implement, good for first-time contributorshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors