-
Notifications
You must be signed in to change notification settings - Fork 2.6k
JIT: add extra check to struct of struct of x promotion #19156
Conversation
Avoid promoting structs that contain struct fields that themselves wrap single simple fields, if those single simple fields are smaller than their enclosing struct. Otherwise we run the risk of losing track of the "extra" bytes in the innner struct. Addresses #19149.
@briansull PTAL @mgravell if you have bigger or other test cases around, feel free to give this a try or send me pointers. No diffs for pmi across x64 fx. Still need to add test case and look at whether there's something that we could do to flag the potential off the end access (so we could keep promotion but make it dependent, perhaps?). |
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.
LGTM with one nit.
src/jit/lclvars.cpp
Outdated
if (fieldSize != innerStructSize) | ||
{ | ||
JITDUMP("Promotion blocked: struct contains struct field with one field," | ||
"but that field is not the same size as its parent."); |
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.
Missing space before 'but'.
Reran jit-diffs across all pri0 tests... including the new test. It's the only case with diffs.
|
All these new failures seem unrelated (AVX_ro and infratructure). The first run had the same code, the new commit fixed a a comment and added a test case. |
I am tracking the CC. @dotnet/dnceng on the Out of Space issue that occurred for the Ubuntu run. |
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.
LGTM
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
Am going to ignore these recent failures. |
Port of dotnet#19156. Avoid promoting structs that contain struct fields that themselves wrap single simple fields, if those single simple fields are smaller than their enclosing struct. Otherwise we run the risk of losing track of the "extra" bytes in the innner struct. Addresses #19149.
Port of dotnet#19156. Avoid promoting structs that contain struct fields that themselves wrap single simple fields, if those single simple fields are smaller than their enclosing struct. Otherwise we run the risk of losing track of the "extra" bytes in the innner struct. Addresses #19149.
Avoid promoting structs that contain struct fields that themselves wrap single simple fields, if those single simple fields are smaller than their enclosing struct. Otherwise we run the risk of losing track of the "extra" bytes in the innner struct. Addresses #19149.
Avoid promoting structs that contain struct fields that themselves
wrap single simple fields, if those single simple fields are smaller
than their enclosing struct.
Otherwise we run the risk of losing track of the "extra" bytes in the
inner struct.
Addresses #19149.