Description
This issue captures the planned work items for .NET 10 with respect to struct improvements. This list is expected to change throughout the release cycle according to ongoing planning and discussions, with possible additions and subtractions to the scope.
The overall goal in .NET 10 is to expand the scope of physical promotion even further than we did in .NET 9. We have seen good improvements from switching classes of struct locals from old promotion to physical promotion and expect similar improvements for the remaining cases. A stretch goal is the full removal of old promotion.
ABI handling for physical promotion
The main limitation that stops physical promotion from replacing regular promotion is currently that it lacks the support around ABI boundaries that regular promotion has. This comes out of the fact that our multireg support is tied very directly into the existing promotion mechanism.
Thus, we expect to work on the following items in .NET 10:
- Support FIELD_LIST for returns in the backend (JIT: Support
FIELD_LIST
for returns #112308) - Support producing FIELD_LIST in physical promotion for returned values, allowing physically promoted return values to stay in registers (JIT: More elaborate store forwarding patterns with physical promotion #86665) (JIT: Support
FIELD_LIST
for returns #112308) - Add a new representation for register-passed struct parameters to the backend (JIT: Generalize parameter register to local mapping in the backend #110795, JIT: Optimize struct parameter register accesses in the backend #110819)
- Allow struct fields of physically promoted parameters to stay in registers via a lowering transformation (JIT: Transform multi-reg args to FIELD_LIST in physical promotion #104370, JIT: Transform single-reg args to FIELD_LIST in physical promotion #111590)
- Add a new representation for register-returned struct values to the backend (in the style of
GT_SWIFT_ERROR
) - Allow struct fields of physically promoted call returns to stay in registers via a lowering transformation
Missing handling for physical promotion
Old promotion handles cases that new promotion does not handle yet. There is work to be done to identify these cases and come up with replacements.
- JIT: Support decomposition into WithElement/GetElement in physical promotion #87554
- JIT: Physical promotion bails on signedness mismatch on small types #104898
- JIT: "Never-negative" handling is not implemented for Span length fields promoted by physical promotion #104573
- JIT: Teach physical promotion to peel FIELD_ADDR nodes #88386
Miscellaneous struct-related work items
- JIT: Propagate LCL_ADDRs into handlers #109182
- JIT: Propagate LCL_ADDRs into natural loops #109190
- Support bitwise field insertions for returns (JIT: Support bitwise field insertions for return registers #113178, JIT: Introduce
LclVarDsc::lvIsMultiRegDest
#113294, JIT: Add some more constant folding in lowering #113301) - Support bitwise field insertions for arguments (JIT: Support bitwise field insertions for call arguments #115977)
- Support bitwise field extractions from parameter registers (JIT: Support bitwise field extractions from parameter registers #112740)
- Support float field extractions from parameter registers
Stretch goals
- Remove old promotion
Metadata
Metadata
Assignees
Labels
Type
Projects
Status