Skip to content

[NativeAOT-LLVM] [Question] Should the generic ctx arg be a native int? #1875

@yowl

Description

@yowl

In the IL backend the generic context arg is passed as an i8*. THe IR for <Boxed>S_P_CoreLib_System_ValueTuple_2<System___Canon__System___Canon>__<unbox>S_P_CoreLib_System_ValueTuple_2__ToStrin looks like

------------ BB02 [000..012) (return), preds={BB01} succs={}
               [000020] ------------                 IL_OFFSET void   IL offset: 0x0
N003 (  3,  2) [000011] ------------        t11 =    LCL_VAR   ref    V00 this
                                                  /--*  t11    ref
N004 (  4,  3) [000012] ---X---N----              *  NULLCHECK byte
N005 (  3,  2) [000013] ------------        t13 =    LCL_VAR   ref    V00 this
N006 (  1,  1) [000014] ------------        t14 =    CNS_INT   int    4 field offset Fseq[Data]
                                                  /--*  t13    ref
                                                  +--*  t14    int
N007 (  5,  4) [000015] ------------        t15 = *  ADD       byref
N009 (  3,  2) [000004] ------------         t4 =    LCL_VAR   ref    V00 this          Zero Fseq[m_pEEType]
                                                  /--*  t4     ref
N010 (  6,  4) [000005] ---XG-------         t5 = *  IND       int
                                                  /--*  t15    byref  this in rcx
                                                  +--*  t5     int    arg1 in rdx
N011 ( 29, 16) [000006] --CXG-------         t6 = *  CALL      ref    System.ValueTuple`2.ToString

t5 is an int and I'm not sure its easy to identify as the generic context. So we end up with signature mismatches. Should we change the generic context in the IL backend to a native int i32 for Wasm32? I don't know what else we can do.

cc @SingleAccretion

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-NativeAOT-LLVMLLVM generation for Native AOT compilation (including Web Assembly)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions