Different codegen for return cond;
vs if (cond) return true; return false;
#8363
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
enhancement
Product code improvement that does NOT require public API changes/additions
JitUntriaged
CLR JIT issues needing additional triage
optimization
tenet-performance
Performance related issue
Milestone
There's a function in corelib used for determining whether a char is whitespace:
https://source.dot.net/#System.Private.CoreLib/shared/System/Char.cs,264
The JIT is generating this code for it:
When I change it to instead be:
the JIT instead generates:
I'd have expected (maybe naively?) these to generate the same asm. Is it expected that they result in different asm? At least on my machine, the change results in measurable throughput difference for Char.IsWhiteSpace (which calls Char.IsWhiteSpaceLatin1), around a ~20% improvement when the char isn't whitespace.
category:cq
theme:basic-cq
skill-level:expert
cost:medium
The text was updated successfully, but these errors were encountered: