-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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 SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issuePerformance related issue
Milestone
Description
C# code:
static int Main(string[] args) {
return string.IsNullOrEmpty(args[0]) ? 42 : 0;
}ASM code:
G_M1504_IG02:
83790800 cmp dword ptr [rcx+8], 0
7628 jbe SHORT G_M1504_IG06
488B4110 mov rax, gword ptr [rcx+16]
4885C0 test rax, rax
7415 je SHORT G_M1504_IG04
83780800 cmp dword ptr [rax+8], 0
0F94C0 sete al ; redundant
0FB6C0 movzx rax, al ; redundant
85C0 test eax, eax ; redundant
7507 jne SHORT G_M1504_IG04
33C0 xor eax, eax
Basically the IL code after inline contains a ceq followed by a brtrue and the JIT compiler doesn't seem capable of folding them.
category:cq
theme:optimization
skill-level:expert
cost:large
jamesqo, pentp, airbreather, ForNeVeR, rameel and 8 more
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 SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issuePerformance related issue