Repository navigation
JIT struct work planned for .NET 8 #76931
Copy link
Copy link
Closed
Labels
User StoryA single user-facing feature. Can be grouped under an epic.A single user-facing feature. Can be grouped under an epic.area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
Description
This issue captures the planned work items for .NET 8 with respect to struct improvements. Smaller workitems that the larger workitems depend on may also be tracked here. This list is expected to change throughout the release cycle according to ongoing planning and discussions, with possible additions and subtractions to the scope.
Planned for .NET 8
Q4 2022
Jan-Mar 2023
- Handle regressions from early liveness
- JIT: Add a stress mode that poisons implicit byrefs #80691
- JIT: Account for GT_JMP implicit uses in local morph ref counting #80734
- JIT: Add Statement::m_treeListEnd #81031
- JIT: Avoid xchg for resolution #81216
- JIT: Update GTF_GLOB_REF after last-use copy omission #81430
- JIT: Avoid omitting copies for struct fields passed implicitly by reference #81787
- Extend scope of early liveness
- JIT: Add a (disabled) prototype for a generalized promotion pass #83388
Apr-Jun 2023
See #76928.
Future/Interesting
- Struct SSA
- Remove existing promotion (or perhaps just remove existing dependent promotion)
- Support field reconstruction with bitwise ops at ABI boundaries
- Support promotion of non-overlapping parts of structs with overlapping fields (non-overlapping up to access)
- Support partial lifetime promotion (Regressions due to QJFL and OSR #67594 (comment))
- [RyuJIT] Introduce a general reverse copy prop for struct temps #8887
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
User StoryA single user-facing feature. Can be grouped under an epic.A single user-facing feature. Can be grouped under an epic.area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Type
Projects
- StatusShow more project fieldsDone
Activity
jakobbotsch commentedon Oct 12, 2022
cc @dotnet/jit-contrib
SingleAccretion commentedon Oct 12, 2022
This would imply teaching liveness to work with parts of non-promoted aggregates (this case is the only benefit of
PROMOTION_TYPE_DEPENDENTas it exists today, AFAIK).What kind of enhancements?
Note this is just an odd limitation of the current scheme. It can easily be lifted by "skipping" all trivial struct wrappers, not just those that ultimately simplify down to a primitive.
jakobbotsch commentedon Oct 12, 2022
The idea (hope) would be that the new promotion pass would create IR that never needed DNER and then dependent promotion could be replaced by the general promotion. I'm sure lots of tuning and work would be required here.
@AndyAyersMS and I were discussing this a while ago for various copy prop/promotion reasons. Also, some SSA forms allow representing some forms of aliasing, which could be interesting in relation to partial lifetime promotion. This one is probably pretty out there though.
Another thing I talked with Andy about recently is going into SSA form during import to let the inliner have SSA form at its disposal. But it does not seem very realistic given all the code we have that would need to be updated, that's why it's not under any immediate plans.
Interesting. I guess you quickly hit the 4 field limit though, but I guess we could look into if it would make sense to raise this limit in some cases (e.g. to be able to promote
Span<T>inside a ref struct).JulieLeeMSFT commentedon Jul 17, 2023
@jakobbotsch, I am closing this as completed. Let's plan remaining items for future or .NET 9.