Skip to content

JIT: Generalized struct promotion #76928

Closed
@jakobbotsch

Description

@jakobbotsch

Description

Struct promotion (a.k.a. scalar replacement of aggregates) is an optimization that replaces structs with their constituent fields, allowing those fields to be optimized as if they were normal local variables. This is a very important optimization for low-level performance oriented code that makes heavy use of structs, so it is important that it is supported well by the JIT.

Limitations

The JIT supports promotion but with the following limitations today:

  • Only whole structs with at most 4 fields can be promoted
  • Nested structs are not supported, except when the nested struct is a wrapper around a primitive type
  • A struct must be promoted for the full duration of the function or not at all
  • Structs with overlapping fields are not supported

This issue is about removing (some of) these limitations.

Q1 work items

Q2 work items

Future work items

CQ

Throughput

Related issues

Metadata

Metadata

Assignees

Labels

Priority:2Work that is important, but not critical for the releasearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions