Skip to content

JIT: local morph impacted by old promotion replacing wrapper structs with fields #115950

Open
@AndyAyersMS

Description

@AndyAyersMS

There are some cases where local morph can't rewrite a field access because old promotion has retyped a struct field wrapper as its field. Eg

[000120] UA-XG------    |  \--*  STORE_LCL_FLD struct<System.DateTime, 8>(P) V06 tmp3         [+8]
                        |     *    ubyte  field V06.hasValue (fldOffset=0x0) -> V09 tmp6         
                        |     *    long   field V06.value (fldOffset=0x8) -> V10 tmp7         
[000117] ---XG------    |     \--*  BLK       struct<System.DateTime, 8>
[000116] -----------    |        \--*  ADD       byref 
[000115] -----------    |           +--*  LCL_VAR   ref    V02 arg2         
[000114] -----------    |           \--*  CNS_INT   long   8

Here V06.value is a struct but the promoted field V10 is retyped as long.

Perhaps we could retype the value side too? Ending up with something like

STORE_LCL_VAR long v10
   GT_IND long
      ADD  byref ...

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions