Skip to content

Add pseudo-instruction to track GC state changes #84313

@BruceForstall

Description

@BruceForstall

There are a few cases in codegen and the emitter where we can omit an instruction (due to it having no register state effect) but where we need to report a change in "GC-ness" of the register state. E.g., a register is a GC ref, but loses that GC ref state at an instruction that is omitted. The JIT depends on the instrDesc idGCref() type to properly set GC state during final emission (it uses this to update the emitThis* variables). So we need some kind of pseudo-instruction on which to place the GC state changes, even if no code is generated.

A need for this was seen in #84051, related to handling ReuseReg, and previously something similar was implemented in #53684 (and later reverted) to handle eliding mov instructions.

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

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions