Skip to content

Eliminate the need to preserve struct handles for SIMD types #69822

@SingleAccretion

Description

@SingleAccretion

Currently, we require most TYP_SIMD nodes in IR to "have" a struct handle (i. e. return something concrete from gtGetStructHandleIfPresent).

This:

  1. Results in confusing invariants because "most" is not "all". E. g. it is legal to have a local variable of TYP_SIMD without a handle.
  2. Makes introducing new nodes that have TYP_SIMD harder (e. g.: Adding support for vector constants via GenTreeVecCon #68874 (comment)).
  3. Makes using TYP_SIMD nodes in IR internally risky, as we must either be able to find some usable handle the user code contained (what the current caching scheme attempts to do) or be very careful not to use the "handle-less" nodes in contexts where a handle might be required of them later on.
  4. Is a canonicalization problem: is the "canonical" indirection for TYP_SIMD an OBJ or an IND? Currently, it's both, with somewhat fragile code in morph that tries to turn one into another, and for copies only.

This requirement is mostly historical, and in my opinion, the best solution to the above problems is to simply eliminate it. Things that need the precise handle (CALLs) should acquire them in other ways.

category:design
theme:structs
skill-level:expert
cost:medium
impact:small

Metadata

Metadata

Assignees

No one assigned

    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