Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

AndyAyersMS
Copy link
Member

@AndyAyersMS AndyAyersMS commented Jul 27, 2018

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.

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.
@AndyAyersMS
Copy link
Member Author

@briansull PTAL
cc @dotnet/jit-contrib

@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?).

Copy link
Member

@erozenfeld erozenfeld left a 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.

if (fieldSize != innerStructSize)
{
JITDUMP("Promotion blocked: struct contains struct field with one field,"
"but that field is not the same size as its parent.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before 'but'.

@AndyAyersMS
Copy link
Member Author

Reran jit-diffs across all pri0 tests... including the new test. It's the only case with diffs.

PMI Diffs for System.Private.CoreLib.dll, framework assemblies, assemblies in d:\repos\coreclr2\bin\tests\Windows_NT.x64.Checked for x64 default jit
Summary:
(Lower is better)
Total bytes of diff: -29 (0.00% of base)
    diff is an improvement.
Top file improvements by size (bytes):
         -29 : JIT\Regression\JitBlue\GitHub_19149\GitHub_19149\GitHub_19149.dasm (-0.44% of base)
1 total files with size differences (1 improved, 0 regressed), 3131 unchanged.
Top method regressions by size (bytes):
          53 : JIT\Regression\JitBlue\GitHub_19149\GitHub_19149\GitHub_19149.dasm - CommandBytes:Equals(ref):bool:this
          14 : JIT\Regression\JitBlue\GitHub_19149\GitHub_19149\GitHub_19149.dasm - Program:<Main>g__HuntFor|0_1(ref,byref):bool
Top method improvements by size (bytes):
         -64 : JIT\Regression\JitBlue\GitHub_19149\GitHub_19149\GitHub_19149.dasm - <>c:<Main>b__0_4(struct):ref:this
         -32 : JIT\Regression\JitBlue\GitHub_19149\GitHub_19149\GitHub_19149.dasm - Program:<Main>g__Add|0_0(ref,byref)
4 total methods with size differences (2 improved, 2 regressed), 363933 unchanged.

@AndyAyersMS
Copy link
Member Author

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.

@tannergooding
Copy link
Member

I am tracking the AVX_ro issue and actively investigating.

CC. @dotnet/dnceng on the Out of Space issue that occurred for the Ubuntu run.

Copy link

@CarolEidt CarolEidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@briansull briansull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good

@AndyAyersMS
Copy link
Member Author

Am going to ignore these recent failures.

@AndyAyersMS AndyAyersMS merged commit d38774d into dotnet:master Jul 27, 2018
@AndyAyersMS AndyAyersMS deleted the Fix19149 branch July 27, 2018 18:09
AndyAyersMS added a commit to AndyAyersMS/coreclr that referenced this pull request Jul 31, 2018
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.
gbalykov pushed a commit to gbalykov/coreclr that referenced this pull request Aug 9, 2018
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.
jashook pushed a commit to jashook/coreclr that referenced this pull request Aug 14, 2018
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants