Skip to content

Do not create unnecessary LEA(b+0) nodes #13548

@mikedn

Description

@mikedn

There's a piece of code in the XARCH emitter that attempts to remove LEA reg, [reg+0] instructions: https://github.com/dotnet/coreclr/blob/4c669eb9ed4400e636d1421412062aa99ccc0dda/src/jit/emitxarch.cpp#L5222

This works fine but such LEAs should not be generated in the first place.

In one such case I looked at, the LEA was generated by Lowering::TryCreateAddrMode from an ADD x, 0. How this ADD was created is another story but lowering should simply remove it, not create an address mode from it.

Initially discussed in dotnet/coreclr#27035 (comment)

category:cq
theme:optimization
skill-level:beginner
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