Epic for improving the ability of the JIT to keep structs in registers.
Overview
The JIT currently supports keeping structs in registers when the individual fields are promoted to local variables (also known as scalar replacement). However, there are a number of cases where it forces them to the stack. Some of these cases are more fundamental, e.g. when they are address exposed. Others, however, are due to JIT limitations in handling argument passing and returns.
The Jit does not support keeping small structs in registers when the fields are not promoted and not accessed, for example, when the struct is only used as an argument or block.
.NET 6 scope:
Work items for multi-reg
Work items for single-reg
Stretch goals for 6.0:
Stretch goal for multi-reg:
Stretch goal for single-reg:
.NET 6 Result:
We have a set of repro-tests that show incorrect/inefficient code generation in 5.0 that is expected to be fixed. It is covered by issues in the previous section.
The perf results are shown in the bottom messages.
category:planning
theme:planning
skill-level:expert
cost:large
impact:medium
Epic for improving the ability of the JIT to keep structs in registers.
Overview
The JIT currently supports keeping structs in registers when the individual fields are promoted to local variables (also known as scalar replacement). However, there are a number of cases where it forces them to the stack. Some of these cases are more fundamental, e.g. when they are address exposed. Others, however, are due to JIT limitations in handling argument passing and returns.
The Jit does not support keeping small structs in registers when the fields are not promoted and not accessed, for example, when the struct is only used as an argument or block.
.NET 6 scope:
Work items for multi-reg
Work items for single-reg
LCL_FLDinstead ofIND(ADDR(LCL_VAR))to avoid marking LCL_VAR as address-taken (struct improvement, part1: create more LCL_FLD #48377);STRESS_PROMOTE_LESS_STRUCTS#49189);Stretch goals for 6.0:
Stretch goal for multi-reg:
Stretch goal for single-reg:
OBJ(ADDR(LCL_VAR))when pass as args etc..NET 6 Result:
We have a set of repro-tests that show incorrect/inefficient code generation in 5.0 that is expected to be fixed. It is covered by issues in the previous section.
The perf results are shown in the bottom messages.
category:planning
theme:planning
skill-level:expert
cost:large
impact:medium