Skip to content

JIT: Keep FieldSeq in AssertionDesc - #78616

Merged
EgorBo merged 9 commits into
dotnet:mainfrom
EgorBo:keep-fldseq-assertdesc
Nov 23, 2022
Merged

EgorBo merged 9 commits into
dotnet:mainfrom
EgorBo:keep-fldseq-assertdesc

Conversation

@EgorBo

@EgorBo EgorBo commented Nov 21, 2022

Copy link
Copy Markdown
Member

Closes #64876

This PR slightly changes memory layout in AssertionDsc (diff) while keeping total size the same (48 bytes) in order to save a reference to FieldSeq*.

Example:

static byte Foo()
{
    ReadOnlySpan<byte> RVA = new byte[] { 1, 2, 3, 4, 5 };
    return RVA[3];
}

JITDump diff: https://www.diffchecker.com/HVVahKbd e.g.:

image

This also is required to be able to fold constant index + RVA in future.

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 21, 2022
@ghost ghost assigned EgorBo Nov 21, 2022
@ghost

ghost commented Nov 21, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

Closes #64876

This PR slightly changes memory layout in AssertionDsc (diff) while keeping total size the same (48 bytes) in order to save a reference to FieldSeq*.

Example:

static byte Foo()
{
    ReadOnlySpan<byte> RVA = new byte[] { 1, 2, 3, 4, 5 };
    return RVA[3];
}

JITDump diff: https://www.diffchecker.com/HVVahKbd e.g.:

image

This also is required to be able to fold constant index + RVA in future.

Author: EgorBo
Assignees: EgorBo
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo
EgorBo force-pushed the keep-fldseq-assertdesc branch from 3f2f953 to 9f57e78 Compare November 21, 2022 11:27
Comment thread src/coreclr/jit/gentree.h Resolved
@EgorBo
EgorBo marked this pull request as ready for review November 22, 2022 10:14
@EgorBo

EgorBo commented Nov 22, 2022

Copy link
Copy Markdown
Member Author

@SingleAccretion @jakobbotsch please, take a look
I need this PR to land another one to fold RVA + constant index

@SingleAccretion SingleAccretion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM modulo minor comments.

Comment thread src/coreclr/jit/compiler.h Resolved
Comment thread src/coreclr/jit/compiler.h Resolved
Comment thread src/coreclr/jit/gentree.cpp Resolved
Comment thread src/coreclr/jit/gentree.cpp Resolved
Comment thread src/coreclr/jit/importer.cpp Resolved
@EgorBo
EgorBo merged commit e56518f into dotnet:main Nov 23, 2022
@EgorBo
EgorBo deleted the keep-fldseq-assertdesc branch November 23, 2022 12:02
@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Constant propagation should preserve field sequences

3 participants