Skip to content

[JIT][arm64] CSE for VSD calls #60025

@EgorBo

Description

@EgorBo
void Test(IDisposable d) => d.Dispose();

Currently emits:

; Method Program:Test(System.IDisposable):this
G_M50981_IG01:              ;; offset=0000H
        A9BF7BFD          stp     fp, lr, [sp,#-16]!
        910003FD          mov     fp, sp
						;; bbWeight=1    PerfScore 1.50

G_M50981_IG02:              ;; offset=0008H
        AA0103E0          mov     x0, x1
        D280080B          movz    x11, #64
        F2B9BB8B          movk    x11, #0xcddc LSL #16
        F2CFFFAB          movk    x11, #0x7ffd LSL #32
        D2800801          movz    x1, #64
        F2B9BB81          movk    x1, #0xcddc LSL #16
        F2CFFFA1          movk    x1, #0x7ffd LSL #32
        F9400021          ldr     x1, [x1]
						;; bbWeight=1    PerfScore 6.50

G_M50981_IG03:              ;; offset=0028H
        A8C17BFD          ldp     fp, lr, [sp],#16
        D61F0020          br      x1
						;; bbWeight=1    PerfScore 2.00
; Total bytes of code: 48

Expected codegen:

; Method Program:Test(System.IDisposable):this
G_M50981_IG01:              ;; offset=0000H
        A9BF7BFD          stp     fp, lr, [sp,#-16]!
        910003FD          mov     fp, sp
						;; bbWeight=1    PerfScore 1.50

G_M50981_IG02:              ;; offset=0008H
        AA0103E0          mov     x0, x1
        D2800801          movz    x1, #64
        F2B9BB81          movk    x1, #0xcddc LSL #16
        F2CFFFA1          movk    x1, #0x7ffd LSL #32
        F9400021          ldr     x1, [x1]
						;; bbWeight=1    PerfScore 6.50

G_M50981_IG03:              ;; offset=0028H
        A8C17BFD          ldp     fp, lr, [sp],#16
        D61F0020          br      x1
						;; bbWeight=1    PerfScore 2.00

/cc @dotnet/jit-contrib

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions