Skip to content

ARM64: Investigate why more stack space is allocated than needed and why they are not aligned #37429

@kunalspathak

Description

@kunalspathak

This was brought to the attention by @TamarChristinaArm in #37139 (comment). For a method that takes 2 Vector64<> parameters, there are couple of problems:

  1. We allocate stack space of 48 bytes although we just want to store 16 bytes.
  2. The 16 bytes that is stored are not aligned properly. If they are aligned properly, we can convert it tp stp instead.

Here is the sample code:

G_M35607_IG01:
        A9BD7BFD          stp     fp, lr, [sp,#-48]!
        910003FD          mov     fp, sp
        FD0017A0          str     d0, [fp,#40]
        FD000FA1          str     d1, [fp,#24]
						;; bbWeight=1    PerfScore 3.50
G_M35607_IG02:
        FD4017B0          ldr     d16, [fp,#40]
        FD400FB1          ldr     d17, [fp,#24]
        0EB01E10          mov     v16.8b, v16.8b

Here is the assembly code for reference: Create_after.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-arm64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMItenet-performancePerformance related issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions