Skip to content

Conversation

@kunalspathak
Copy link
Contributor

#70170 exposed an issue because we started folding ADDR(LCL_FLD <original struct>) and removed the information about the fields.

image

There is a similar field access for parent struct and we think that the current field's zero-init is redundant and can be safely removed.

STMT00010 ( INL02 @ 0x000[E-] ... ??? ) <- INL01 @ 0x000[E-] <- INLRT @ 0x000[E-]
N003 (  5,  4) [000043] -A--G---R--                         *  ASG       int   
N002 (  3,  2) [000040] D---G--N---                         +--*  LCL_VAR   int   (AX) V07 tmp3         
N001 (  1,  1) [000041] -----------                         \--*  CNS_INT   int    0

***** BB01
STMT00009 ( INL01 @ 0x007[E-] ... ??? ) <- INLRT @ 0x000[E-]
N003 (  5,  6) [000035] -A--G---R--                         *  ASG       int   
N002 (  3,  4) [000029] D---G--N---                         +--*  LCL_FLD   int    V07 tmp3         [+4]
N001 (  1,  1) [000033] -----------                         \--*  CNS_INT   int    0

The fix is to before making it LCL_FLD make sure that the offsets are same too.

Fixes: #70791

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 7, 2022
@ghost ghost assigned kunalspathak Jul 7, 2022
@ghost
Copy link

ghost commented Jul 7, 2022

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

Issue Details

#70170 exposed an issue because we started folding ADDR(LCL_FLD <original struct>) and removed the information about the fields.

image

There is a similar field access for parent struct and we think that the current field's zero-init is redundant and can be safely removed.

STMT00010 ( INL02 @ 0x000[E-] ... ??? ) <- INL01 @ 0x000[E-] <- INLRT @ 0x000[E-]
N003 (  5,  4) [000043] -A--G---R--                         *  ASG       int   
N002 (  3,  2) [000040] D---G--N---                         +--*  LCL_VAR   int   (AX) V07 tmp3         
N001 (  1,  1) [000041] -----------                         \--*  CNS_INT   int    0

***** BB01
STMT00009 ( INL01 @ 0x007[E-] ... ??? ) <- INLRT @ 0x000[E-]
N003 (  5,  6) [000035] -A--G---R--                         *  ASG       int   
N002 (  3,  4) [000029] D---G--N---                         +--*  LCL_FLD   int    V07 tmp3         [+4]
N001 (  1,  1) [000033] -----------                         \--*  CNS_INT   int    0

The fix is to before making it LCL_FLD make sure that the offsets are same too.

Fixes: #70791

Author: kunalspathak
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@kunalspathak
Copy link
Contributor Author

@dotnet/jit-contrib @SingleAccretion

@kunalspathak kunalspathak merged commit e4284b8 into dotnet:main Jul 8, 2022
@kunalspathak kunalspathak deleted the lclfld_offset branch July 8, 2022 15:16
kunalspathak added a commit to kunalspathak/runtime that referenced this pull request Jul 18, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 7, 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.

Test failure: Interop\\IJW\\CopyConstructorMarshaler\\CopyConstructorMarshaler\\CopyConstructorMarshaler.cmd

3 participants