Skip to content

Inlining in shared generic code leaves unused temp behind #7421

@jkotas

Description

@jkotas

Forked from dotnet/coreclr#9541 (comment).

The code for List<__Canon>::Clear() after dotnet/coreclr#9540:

G_M58440_IG01:
       56                   push     rsi
       4883EC30             sub      rsp, 48
       48894C2428           mov      qword ptr [rsp+28H], rcx
       488BF1               mov      rsi, rcx

G_M58440_IG02:
       488B0E               mov      rcx, qword ptr [rsi]        ;** ?? --- redundant load?        
       448B4618             mov      r8d, dword ptr [rsi+24]     ; int size = _size;
       33C9                 xor      ecx, ecx                    ;** 0 ----^ clears earlier move
...

The redundant load is left over temp from optimized out dictionary lookup. Can we get rid of it?

Jit Dump: ListClear.txt

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
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions