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.
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
instrDescidGCref()type to properly set GC state during final emission (it uses this to update theemitThis*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
movinstructions.