Skip to content

Remove redundant store that is immediately after the load in same src/dst #35614

Closed
@kunalspathak

Description

@kunalspathak

I have seen below pattern in generated code for framework libraries. We can eliminate the str if it is storing the value from same register that was used to load in previous instruction from same memory location.

Example of ARM64 code:

B9404260          ldr     w0, [x19,#64]
B9004260          str     w0, [x19,#64]

Example of x64 code:

8B4640               mov      eax, dword ptr [rsi+64]
894640               mov      dword ptr [rsi+64], eax

There are approx. 250 such patterns in 250 methods. Details in ldr-str.txt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions