Skip to content

[ARM64/Linux] Inefficiencies when using initializing/cleaning unsafe pointers #12736

@TamarChristinaArm

Description

@TamarChristinaArm

For the following case with QuickJIT turned off

static int[] Test(int[] a)
{
  unsafe {
    fixed (int *a_ptr = a, b_ptr = b)
    {
    }
  }
  return a;
}

The initialization of the pointer correctly uses the zero register

        F9000FBF          str     xzr, [fp,#24] // [V05 loc2]
        F9000BBF          str     xzr, [fp,#16] // [V06 loc3]

However it doesn't use stp/ldp when it's possible to.

also when cleaning up the strs suddenly don't use xzr anymore

        D2800001          mov     x1, #0
        F9000FA1          str     x1, [fp,#24]  // [V05 loc2]
        F9000BA1          str     x1, [fp,#16]  // [V06 loc3]

/CC @CarolEidt @tannergooding

category:cq
theme:basic-cq
skill-level:intermediate
cost:medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    JitUntriagedCLR JIT issues needing additional triagearch-arm64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions