-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JIT: Store padding information in ClassLayout/ClassLayoutBuilder #112212
Conversation
* Rename `StructSegments` -> `SegmentList` * Add `ClassLayout::GetNonPadding` to get the non-padding of a class layout. Computed lazily for `CORINFO_CLASS_HANDLE` backed layouts and saved ahead of time for custom layouts. * Add `ClassLayoutBuilder::AddPadding` and `ClassLayoutBuilder::RemovePadding` * Remove `Compiler::GetSignificantSegments` and switch uses to `ClassLayout->GetNonPadding()`
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
FYI @AndyAyersMS... I don't expect this to get us much given that stack allocated arrays are never handled by physical promotion due to address exposure, and physical promotion is the only user of padding information (today). I think we can change object stack allocation to create custom layouts for all cases without regressions after this change. That should allow us to remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for struct cases.
Seems like for arrays of structs with padding this may end up creating a lot of data that we may never look at?
True. We can have object stack allocation avoid marking any padding for arrays for now and reevaluate if/when we end up with something that would actually benefit from it. Also seeing some significant TP regressions, likely from block layouts always allocating the padding information. Will change so that it's created lazily for the cases with no padding. |
No diffs now. cc @dotnet/jit-contrib PTAL @AndyAyersMS |
StructSegments
->SegmentList
ClassLayout::GetNonPadding
to get the non-padding of a class layout. Computed lazily forCORINFO_CLASS_HANDLE
backed layouts and saved ahead of time for custom layouts.ClassLayoutBuilder::AddPadding
andClassLayoutBuilder::RemovePadding
Compiler::GetSignificantSegments
and switch uses toClassLayout->GetNonPadding()