Skip to content

[RyuJIT] Fully enregister structs that fit into a single register when profitable #8016

Closed
@CarolEidt

Description

@CarolEidt

When a struct is small enough to fit into a register, and is only accessed in its entirety (e.g. to initialize or pass as an argument), it should be fully enregistered. Below is a simple test case that was provided with a bug filed against the desktop version. It should generate simply xor eax; ret on x86 and x64, but instead generates many unnecessary copies. It is addressed by full enregistration of structs that fit into a register (see work item dotnet/coreclr#7 in https://github.com/dotnet/runtime/blob/master/docs/design/coreclr/jit/first-class-structs.md#support-full-enregistration-of-struct-types):

struct foo { public byte b1, b2, b3, b4; }
static foo getfoo() { return new foo(); }

category:cq
theme:structs
skill-level:expert
cost:large

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions