Skip to content

Fix and clean up the handling of "must contain" LEAs on ARM64 #74448

Open
@SingleAccretion

Description

@SingleAccretion

On ARM64, certain LEAs (those with contained indices) must always be contained under indirections.

Currently, there are (at least) two scenarios where we can call TryCreateAddrMode and then not contain the address modes it can create:

  1. For STOREIND<ref>(...) with write barriers.
  2. For [STORE]IND<SIMD12>(...) nodes.

We should find a way to factor the code such that we do not try to create the uncontainable LEAs for them and delete the (incomplete) handling codegen has for them in genLeaInstruction.

Additionally, after #74275, we should no longer need to check IsSafeToContainMem before calling TryCreateAddrMode in LowerIndir/LowerStoreIndirCommon.

Longer-term, we should make it such that we don't need genLeaInstruction or internal registers for indirection nodes on our load-store targets at all, i. e. we should only generate address modes directly supported by the target.

category:correctness
theme:codegen
skill-level:expert
cost:medium
impact:small

Metadata

Metadata

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions