ronantakizawa/codereview-bench huggingface dataset:
Repository: dotnet/runtime
File: src/coreclr/interpreter/simdhash.h (C/C++)

Code before:
    void free_hash_and_values()
    {
        if (Value == nullptr)
            return;
        if (ValueDestroyCallback)
            dn_simdhash_ptr_ptr_foreach(Value, ValueDestroyCallback, nullptr);
        dn_simdhash_free(Value);
        Value = nullptr;
    }

public:
    dn_simdhash_ptr_ptr_holder(dn_simdhash_ptr_ptr_foreach_func valueDestroyCallback = nullptr)
        : ValueDestroyCallback(valueDestroyCallback)
        , Value(nullptr)
    {
    }

    dn_simdhash_ptr_ptr_t* GetValue()
    {
        if (!Value)
            Value = dn_simdhash_ptr_ptr_new(0, nullptr);

        if (Value == nullptr)
            NOMEM();

            return Value;
    }

    bool HasValue()
    {
        return Value != nullptr;
    }

    dn_simdhash_ptr_ptr_holder(const dn_simdhash_ptr_ptr_holder&) = delete;
    dn_simdhash_ptr_ptr_holder& operator=(const dn_simdhash_ptr_ptr_holder&) = delete;
    dn_simdhash_ptr_ptr_holder(dn_simdhash_ptr_ptr_holder&& other)
    {
        Value = other.Value;
        other.Value = nullptr;
    }
    dn_simdhash_ptr_ptr_holder& operator=(dn_simdhash_ptr_ptr_holder&& other)
    {
        if (this != &other)
        {
            free_hash_and_values();
            Value = other.Value;
            other.Value = nullptr;
        }
        return *this;
    }


Review comment (bug):
Incorrect indentation: the `return Value;` statement should be indented at the same level as the `if` statements above it, not nested deeper. This appears to be an unintentional indentation change that affects code readability.
```suggestion
        return Value;
```

Code after:
    void free_hash_and_values()
    {
        if (Value == nullptr)
            return;
        if (ValueDestroyCallback)
            dn_simdhash_ptr_ptr_foreach(Value, ValueDestroyCallback, nullptr);
        dn_simdhash_free(Value);
        Value = nullptr;
    }

public:
    dn_simdhash_ptr_ptr_holder(dn_simdhash_ptr_ptr_foreach_func valueDestroyCallback = nullptr)
        : ValueDestroyCallback(valueDestroyCallback)
        , Value(nullptr)
    {
    }

    dn_simdhash_ptr_ptr_t* GetValue()
    {
        if (!Value)
            Value = dn_simdhash_ptr_ptr_new(0, nullptr);

        if (Value == nullptr)
            NOMEM();

        return Value;
    }

    bool HasValue()
    {
        return Value != nullptr;
    }

    dn_simdhash_ptr_ptr_holder(const dn_simdhash_ptr_ptr_holder&) = delete;
    dn_simdhash_ptr_ptr_holder& operator=(const dn_simdhash_ptr_ptr_holder&) = delete;
    dn_simdhash_ptr_ptr_holder(dn_simdhash_ptr_ptr_holder&& other)
    {
        Value = other.Value;
        ValueDestroyCallback = other.ValueDestroyCallback;
        other.Value = nullptr;
        other.ValueDestroyCallback = nullptr;
    }
    dn_simdhash_ptr_ptr_holder& operator=(dn_simdhash_ptr_ptr_holder&& other)
    {
        if (this != &other)
        {
            free_hash_and_values();
            Value = other.Value;
            ValueDestroyCallback = other.ValueDestroyCallback;
            other.Value = nullptr;
            other.ValueDestroyCallback = nullptr;
Repository: dotnet/runtime
File: src/coreclr/interpreter/simdhash.h (C/C++)

Code before:
    {
    }

    dn_simdhash_u64_ptr_t* GetValue()
    {
        if (!Value)
            Value = dn_simdhash_u64_ptr_new(0, nullptr);

        if (Value == nullptr)
            NOMEM();

        return Value;
    }

    bool HasValue()
    {
        return Value != nullptr;
    }

    dn_simdhash_u64_ptr_holder(const dn_simdhash_u64_ptr_holder&) = delete;
    dn_simdhash_u64_ptr_holder& operator=(const dn_simdhash_u64_ptr_holder&) = delete;
    dn_simdhash_u64_ptr_holder(dn_simdhash_u64_ptr_holder&& other)
    {
        Value = other.Value;
        other.Value = nullptr;
    }
    dn_simdhash_u64_ptr_holder& operator=(dn_simdhash_u64_ptr_holder&& other)
    {
        if (this != &other)
        {
            free_hash_and_values();
            Value = other.Value;
            other.Value = nullptr;
        }
        return *this;
    }

    ~dn_simdhash_u64_ptr_holder()
    {
        free_hash_and_values();
    }
};

// Asserts that no error occurred during a simdhash add, but does not mind if no new item was inserted
inline void checkNoError(dn_simdhash_add_result result)
{
    if (result == DN_SIMDHASH_OUT_OF_MEMORY)
        NOMEM();
    else if (result < 0)
        NO_WAY("Internal error in simdhash");
}

Review comment (bug):
Missing `ValueDestroyCallback` transfer in move constructor: The move constructor should transfer the `ValueDestroyCallback` member from `other` and set it to `nullptr` in `other`, similar to how `Value` is handled. Without this, if `other` is destroyed after the move, it may still try to invoke the callback on values that now belong to the moved-to object. Add `ValueDestroyCallback = other.ValueDestroyCallback; other.ValueDestroyCallback = nullptr;` to fix this issue.

Code after:
public:
    dn_simdhash_u32_ptr_holder(dn_simdhash_u32_ptr_foreach_func valueDestroyCallback = nullptr)
        : ValueDestroyCallback(valueDestroyCallback)
        , Value(nullptr)
    {
    }

    dn_simdhash_u32_ptr_t* GetValue()
    {
        if (!Value)
            Value = dn_simdhash_u32_ptr_new(0, nullptr);

        if (Value == nullptr)
            NOMEM();

        return Value;
    }

    bool HasValue()
    {
        return Value != nullptr;
    }

    dn_simdhash_u32_ptr_holder(const dn_simdhash_u32_ptr_holder&) = delete;
    dn_simdhash_u32_ptr_holder& operator=(const dn_simdhash_u32_ptr_holder&) = delete;
    dn_simdhash_u32_ptr_holder(dn_simdhash_u32_ptr_holder&& other)
    {
        Value = other.Value;
        ValueDestroyCallback = other.ValueDestroyCallback;
        other.Value = nullptr;
        other.ValueDestroyCallback = nullptr;
    }
    dn_simdhash_u32_ptr_holder& operator=(dn_simdhash_u32_ptr_holder&& other)
    {
        if (this != &other)
        {
            free_hash_and_values();
            Value = other.Value;
            ValueDestroyCallback = other.ValueDestroyCallback;
            other.Value = nullptr;
            other.ValueDestroyCallback = nullptr;
        }
        return *this;
    }

    ~dn_simdhash_u32_ptr_holder()
    {
        free_hash_and_values();
    }
};
Repository: dotnet/runtime
File: src/coreclr/jit/codegenwasm.cpp (C++)

Code before:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#include "jitpch.h"
#ifdef _MSC_VER
#pragma hdrstop
#endif

#include "codegen.h"
#include "fgwasm.h"

void CodeGen::genMarkLabelsForCodegen()
{
    // We have alredy marked labels, so nothing to do here
}

void CodeGen::genFnEpilog(BasicBlock* block)
{
#ifdef DEBUG
    if (verbose)
    {
        printf("*************** In genFnEpilog()\n");
    }
#endif // DEBUG

    ScopedSetVariable<bool> _setGeneratingEpilog(&compiler->compGeneratingEpilog, true);

#ifdef DEBUG
    if (compiler->opts.dspCode)
        printf("\n__epilog:\n");
#endif // DEBUG

    bool jmpEpilog = block->HasFlag(BBF_HAS_JMP);

    if (jmpEpilog)
    {
        NYI_WASM("genFnEpilog: jmpEpilog");
    }


Review comment (suggestion):
Spelling error: "alredy" should be "already".
```suggestion
    // We have already marked labels, so nothing to do here
```

Code after:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#include "jitpch.h"
#ifdef _MSC_VER
#pragma hdrstop
#endif

#include "codegen.h"
#include "fgwasm.h"

void CodeGen::genMarkLabelsForCodegen()
{
    // No work needed here for now.
    // We mark labels as needed in genEmitStartBlock.
}

void CodeGen::genFnEpilog(BasicBlock* block)
{
#ifdef DEBUG
    if (verbose)
    {
        printf("*************** In genFnEpilog()\n");
    }
#endif // DEBUG

    ScopedSetVariable<bool> _setGeneratingEpilog(&compiler->compGeneratingEpilog, true);

#ifdef DEBUG
    if (compiler->opts.dspCode)
        printf("\n__epilog:\n");
#endif // DEBUG

    bool jmpEpilog = block->HasFlag(BBF_HAS_JMP);

    if (jmpEpilog)
    {
        NYI_WASM("genFnEpilog: jmpEpilog");
    }
Repository: dotnet/runtime
File: src/coreclr/jit/emitwasm.cpp (C++)

Code before:
// emitIns_I: Emit an instruction with an immediate operand.
//
// Arguments:
//   ins      - instruction to emit
//   attr     - emit attributes
//   imm      - immediate value
//
void emitter::emitIns_I(instruction ins, emitAttr attr, cnsval_ssize_t imm)
{
    instrDesc* id  = emitNewInstrSC(attr, imm);
    insFormat  fmt = emitInsFormat(ins);

    id->idIns(ins);
    id->idInsFmt(fmt);

    dispIns(id);
    appendToCurIG(id);
}

//------------------------------------------------------------------------
// emitIns_J: Emit a jump instruction with an immediate operand.
//
// Arguments:
//   ins         - instruction to emit
//   attr        - emit attributes
//   imm         - immediiate value (depth in control flow stack)
//   targetBlock - block at that depth
//
void emitter::emitIns_J(instruction ins, emitAttr attr, cnsval_ssize_t imm, BasicBlock* targetBlock)
{
    instrDesc* id  = emitNewInstrSC(attr, imm);
    insFormat  fmt = emitInsFormat(ins);

    id->idIns(ins);
    id->idInsFmt(fmt);

    if (m_debugInfoSize > 0)
    {
        id->idDebugOnlyInfo()->idTargetBlock = targetBlock;
    }

    dispIns(id);
    appendToCurIG(id);
}

//------------------------------------------------------------------------
// emitIns_S: Emit a memory instruction with a stack-based address mode operand.
//
void emitter::emitIns_S(instruction ins, emitAttr attr, int varx, int offs)
{
    bool FPBased;

Review comment (suggestion):
```suggestion
//   imm         - immediate value (depth in control flow stack)
```

Code after:
// emitIns_I: Emit an instruction with an immediate operand.
//
// Arguments:
//   ins      - instruction to emit
//   attr     - emit attributes
//   imm      - immediate value
//
void emitter::emitIns_I(instruction ins, emitAttr attr, cnsval_ssize_t imm)
{
    instrDesc* id  = emitNewInstrSC(attr, imm);
    insFormat  fmt = emitInsFormat(ins);

    id->idIns(ins);
    id->idInsFmt(fmt);

    dispIns(id);
    appendToCurIG(id);
}

//------------------------------------------------------------------------
// emitIns_J: Emit a jump instruction with an immediate operand.
//
// Arguments:
//   ins         - instruction to emit
//   attr        - emit attributes
//   imm         - immediate value (depth in control flow stack)
//   targetBlock - block at that depth
//
void emitter::emitIns_J(instruction ins, emitAttr attr, cnsval_ssize_t imm, BasicBlock* targetBlock)
{
    instrDesc* id  = emitNewInstrSC(attr, imm);
    insFormat  fmt = emitInsFormat(ins);

    id->idIns(ins);
    id->idInsFmt(fmt);

    if (m_debugInfoSize > 0)
    {
        id->idDebugOnlyInfo()->idTargetBlock = targetBlock;
    }

    dispIns(id);
    appendToCurIG(id);
}

//------------------------------------------------------------------------
// emitIns_S: Emit a memory instruction with a stack-based address mode operand.
//
void emitter::emitIns_S(instruction ins, emitAttr attr, int varx, int offs)
{
    bool FPBased;
Repository: dotnet/runtime
File: src/coreclr/jit/lowerwasm.cpp (C++)

Code before:
//    Next node to lower.
//
GenTree* Lowering::LowerStoreIndir(GenTreeStoreInd* node)
{
    ContainCheckStoreIndir(node);
    return node->gtNext;
}

//------------------------------------------------------------------------
// LowerMul: Lower a GT_MUL node.
//
// Arguments:
//    mul - The node to lower
//
// Return Value:
//    The next node to lower.
//
GenTree* Lowering::LowerMul(GenTreeOp* mul)
{
    assert(mul->OperIs(GT_MUL));
    ContainCheckMul(mul);
    return mul->gtNext;
}

//------------------------------------------------------------------------
// LowerMul: Lower a GT_NEG node.
//
// Arguments:
//    node - The node to lower
//
// Return Value:
//    The next node to lower.
//
GenTree* Lowering::LowerNeg(GenTreeOp* node)
{
    if (!node->TypeIs(TYP_INT, TYP_LONG))
    {
        return node->gtNext;
    }

    // For ints, NEG(x) ==> SUB(0, x)
    //
    GenTree* x    = node->gtGetOp1();
    GenTree* zero = comp->gtNewZeroConNode(node->TypeGet());
    BlockRange().InsertBefore(x, zero);
    LowerNode(zero);
    node->ChangeOper(GT_SUB);
    node->gtOp1 = zero;
    node->gtOp2 = x;

    return LowerNode(node);

Review comment (bug):
The documentation comment incorrectly says "LowerMul" but should say "LowerNeg" to match the function name.
```suggestion
// LowerNeg: Lower a GT_NEG node.
```

Code after:
//    Next node to lower.
//
GenTree* Lowering::LowerStoreIndir(GenTreeStoreInd* node)
{
    ContainCheckStoreIndir(node);
    return node->gtNext;
}

//------------------------------------------------------------------------
// LowerMul: Lower a GT_MUL node.
//
// Arguments:
//    mul - The node to lower
//
// Return Value:
//    The next node to lower.
//
GenTree* Lowering::LowerMul(GenTreeOp* mul)
{
    assert(mul->OperIs(GT_MUL));
    ContainCheckMul(mul);
    return mul->gtNext;
}

//------------------------------------------------------------------------
// LowerNeg: Lower a GT_NEG node.
//
// Arguments:
//    node - The node to lower
//
// Return Value:
//    The next node to lower.
//
GenTree* Lowering::LowerNeg(GenTreeOp* node)
{
    if (!node->TypeIs(TYP_INT, TYP_LONG))
    {
        return node->gtNext;
    }

    // For integer types (TYP_INT and TYP_LONG), NEG(x) ==> SUB(0, x)
    //
    GenTree* x    = node->gtGetOp1();
    GenTree* zero = comp->gtNewZeroConNode(node->TypeGet());
    BlockRange().InsertBefore(x, zero);
    LowerNode(zero);
    node->ChangeOper(GT_SUB);
    node->gtOp1 = zero;
    node->gtOp2 = x;

    return LowerNode(node);
Repository: dotnet/runtime
File: src/coreclr/jit/lowerwasm.cpp (C++)

Code before:
//    The next node to lower.
//
GenTree* Lowering::LowerMul(GenTreeOp* mul)
{
    assert(mul->OperIs(GT_MUL));
    ContainCheckMul(mul);
    return mul->gtNext;
}

//------------------------------------------------------------------------
// LowerMul: Lower a GT_NEG node.
//
// Arguments:
//    node - The node to lower
//
// Return Value:
//    The next node to lower.
//
GenTree* Lowering::LowerNeg(GenTreeOp* node)
{
    if (!node->TypeIs(TYP_INT, TYP_LONG))
    {
        return node->gtNext;
    }

    // For ints, NEG(x) ==> SUB(0, x)
    //
    GenTree* x    = node->gtGetOp1();
    GenTree* zero = comp->gtNewZeroConNode(node->TypeGet());
    BlockRange().InsertBefore(x, zero);
    LowerNode(zero);
    node->ChangeOper(GT_SUB);
    node->gtOp1 = zero;
    node->gtOp2 = x;

    return LowerNode(node);
}

//------------------------------------------------------------------------
// Lowering::LowerJTrue: Lowers a JTRUE node.
//
// Arguments:
//    jtrue - the JTRUE node
//
// Return Value:
//    The next node to lower (usually nullptr).
//
// Notes:
//    For wasm we handle all this in codegen
//
GenTree* Lowering::LowerJTrue(GenTreeOp* jtrue)

Review comment (suggestion):
The comment says "For ints" but this transformation applies to both TYP_INT and TYP_LONG. Consider changing to "For ints and longs" or "For integer types".
```suggestion
    // For integer types (TYP_INT and TYP_LONG), NEG(x) ==> SUB(0, x)
```

Code after:
//    The next node to lower.
//
GenTree* Lowering::LowerMul(GenTreeOp* mul)
{
    assert(mul->OperIs(GT_MUL));
    ContainCheckMul(mul);
    return mul->gtNext;
}

//------------------------------------------------------------------------
// LowerNeg: Lower a GT_NEG node.
//
// Arguments:
//    node - The node to lower
//
// Return Value:
//    The next node to lower.
//
GenTree* Lowering::LowerNeg(GenTreeOp* node)
{
    if (!node->TypeIs(TYP_INT, TYP_LONG))
    {
        return node->gtNext;
    }

    // For integer types (TYP_INT and TYP_LONG), NEG(x) ==> SUB(0, x)
    //
    GenTree* x    = node->gtGetOp1();
    GenTree* zero = comp->gtNewZeroConNode(node->TypeGet());
    BlockRange().InsertBefore(x, zero);
    LowerNode(zero);
    node->ChangeOper(GT_SUB);
    node->gtOp1 = zero;
    node->gtOp2 = x;

    return LowerNode(node);
}

//------------------------------------------------------------------------
// Lowering::LowerJTrue: Lowers a JTRUE node.
//
// Arguments:
//    jtrue - the JTRUE node
//
// Return Value:
//    The next node to lower (usually nullptr).
//
// Notes:
//    For wasm we handle all this in codegen
//
GenTree* Lowering::LowerJTrue(GenTreeOp* jtrue)
Repository: dotnet/runtime
File: src/coreclr/jit/emit.h (C/C++)

Code before:
        instrDesc* id = emitNewInstrSmall(attr);
        id->idSmallCns(cns);

#if EMITTER_STATS
        TrackSmallCns(cns);
#endif

        return id;
    }
    else
    {
        instrDescCns* id = emitAllocInstrCns(attr, cns);

#if EMITTER_STATS
        TrackLargeCns(cns);
#endif

        return id;
    }
}

#ifdef TARGET_WASM
#include "wasmtypesdef.h"

#endif

#ifdef TARGET_ARM

inline emitter::instrDesc* emitter::emitNewInstrReloc(emitAttr attr, BYTE* addr)
{
    assert(EA_IS_RELOC(attr));

    instrDescReloc* id = (instrDescReloc*)emitAllocAnyInstr(sizeof(instrDescReloc), attr);
    assert(id->idIsReloc());

    id->idrRelocVal = addr;

#if EMITTER_STATS
    emitTotalIDescRelocCnt++;
#endif // EMITTER_STATS

    return id;
}

#endif // TARGET_ARM

#ifdef TARGET_RISCV64

inline emitter::instrDesc* emitter::emitNewInstrLoadImm(emitAttr attr, cnsval_ssize_t cns)
{
    instrDescLoadImm* id = static_cast<instrDescLoadImm*>(emitAllocAnyInstr(sizeof(instrDescLoadImm), attr));

Review comment (refactor):
This include block appears to be empty. The header inclusion for wasmtypesdef.h is already present earlier in the file (line 644) under the same TARGET_WASM condition. This duplicate inclusion guard is unnecessary and should be removed.
```suggestion

```

Code after:
#if EMITTER_STATS
        TrackLargeCns(cns);
#endif

        return id;
    }
}

#ifdef TARGET_ARM

inline emitter::instrDesc* emitter::emitNewInstrReloc(emitAttr attr, BYTE* addr)
{
    assert(EA_IS_RELOC(attr));

    instrDescReloc* id = (instrDescReloc*)emitAllocAnyInstr(sizeof(instrDescReloc), attr);
    assert(id->idIsReloc());

    id->idrRelocVal = addr;

#if EMITTER_STATS
    emitTotalIDescRelocCnt++;
#endif // EMITTER_STATS

    return id;
}

#endif // TARGET_ARM

#ifdef TARGET_RISCV64

inline emitter::instrDesc* emitter::emitNewInstrLoadImm(emitAttr attr, cnsval_ssize_t cns)
{
    instrDescLoadImm* id = static_cast<instrDescLoadImm*>(emitAllocAnyInstr(sizeof(instrDescLoadImm), attr));
    id->idInsOpt(INS_OPTS_I);
    id->idcCnsVal = cns;
    return id;
}

#endif // TARGET_RISCV64

#ifdef TARGET_XARCH

/*****************************************************************************
 *
 *  The following helpers should be used to access the various values that
 *  get stored in different places within the instruction descriptor.
 */

inline ssize_t emitter::emitGetInsCns(instrDesc* id) const
{
    return id->idIsLargeCns() ? ((instrDescCns*)id)->idcCnsVal : id->idSmallCns();
Repository: dotnet/runtime
File: src/coreclr/jit/emitfmtswasm.h (C/C++)

Code before:
};
#undef DEFINE_ID_OPS

#else // !DEFINE_ID_OPS

#ifndef IF_DEF
#error Must define IF_DEF macro before including this file
#endif

//////////////////////////////////////////////////////////////////////////////
//
// enum insFormat   instruction            enum ID_OPS
//                  scheduling
//                  (unused)
//////////////////////////////////////////////////////////////////////////////

IF_DEF(NONE,       IS_NONE, NONE)
IF_DEF(OPCODE,     IS_NONE, NONE) // <opcode>
IF_DEF(BLOCK,      IS_NONE, NONE) // <opcode> <0x40>
IF_DEF(LABEL,      IS_NONE, NONE) // <ULEB128 immediate>
IF_DEF(ULEB128,    IS_NONE, NONE) // <opcode> <ULEB128 immediate>
IF_DEF(SLEB128,    IS_NONE, NONE) // <opcode> <LEB128 immediate (signed)>
IF_DEF(F32,        IS_NONE, NONE) // <opcode> <f32 immediate (stored as 64-bit integer constant)>
IF_DEF(F64,        IS_NONE, NONE) // <opcode> <f64 immediate (stored as 64-bit integer constant)>
IF_DEF(MEMARG,     IS_NONE, NONE) // <opcode> <memarg> (<align> <offset>)
IF_DEF(LOCAL_CNT,  IS_NONE, NONE) // <ULEB128 immediate> 
IF_DEF(LOCAL_DECL, IS_NONE, NONE) // <ULEB128 immediate> <byte>

#undef IF_DEF
#endif // !DEFINE_ID_OPS
// clang-format on


Review comment (suggestion):
This line has trailing whitespace after the comment. According to the .editorconfig rules, trailing whitespace should be removed.
```suggestion
IF_DEF(LOCAL_CNT,  IS_NONE, NONE) // <ULEB128 immediate>
```

Code after:
};
#undef DEFINE_ID_OPS

#else // !DEFINE_ID_OPS

#ifndef IF_DEF
#error Must define IF_DEF macro before including this file
#endif

//////////////////////////////////////////////////////////////////////////////
//
// enum insFormat   instruction            enum ID_OPS
//                  scheduling
//                  (unused)
//////////////////////////////////////////////////////////////////////////////

IF_DEF(NONE,        IS_NONE, NONE)
IF_DEF(OPCODE,      IS_NONE, NONE) // <opcode>
IF_DEF(BLOCK,       IS_NONE, NONE) // <opcode> <0x40>
IF_DEF(RAW_ULEB128, IS_NONE, NONE) // <ULEB128 immediate>
IF_DEF(ULEB128,     IS_NONE, NONE) // <opcode> <ULEB128 immediate>
IF_DEF(SLEB128,     IS_NONE, NONE) // <opcode> <LEB128 immediate (signed)>
IF_DEF(F32,         IS_NONE, NONE) // <opcode> <f32 immediate (stored as 64-bit integer constant)>
IF_DEF(F64,         IS_NONE, NONE) // <opcode> <f64 immediate (stored as 64-bit integer constant)>
IF_DEF(MEMARG,      IS_NONE, NONE) // <opcode> <memarg> (<align> <offset>)
IF_DEF(LOCAL_DECL,  IS_NONE, NONE) // <ULEB128 immediate> <byte>

#undef IF_DEF
#endif // !DEFINE_ID_OPS
// clang-format on
Repository: dotnet/runtime
File: src/coreclr/jit/emit.h (C/C++)

Code before:
            _idOpSize = emitEncodeSize(opsz);
        }

        GCtype idGCref() const
        {
            return (GCtype)_idGCref;
        }
        void idGCref(GCtype gctype)
        {
            _idGCref = gctype;
        }

        regNumber idReg1() const
        {
            return _idReg1;
        }
        void idReg1(regNumber reg)
        {
            _idReg1 = reg;
            assert(reg == _idReg1);
        }

#ifdef TARGET_WASM
        bool idIsLclVarDecl() const
        {
            return (_idLclDecl != 0);
        }

        void idSetIsLclVarDecl(bool isDecl)
        {
            _idLclDecl = isDecl ? 1 : 0;
        }
#endif

#ifdef TARGET_ARM64
        GCtype idGCrefReg2() const
        {
            assert(!idIsSmallDsc());
            return (GCtype)idAddr()->_idGCref2;
        }
        void idGCrefReg2(GCtype gctype)
        {
            assert(!idIsSmallDsc());
            idAddr()->_idGCref2 = gctype;
        }
#endif // TARGET_ARM64

        regNumber idReg2() const
        {
            return _idReg2;
        }

Review comment (suggestion):
You don't actually need this bit, you can deduce this descriptor type based on the format.

(Actually, you don't _need_ a new instruction desc either, since you can pack the count + type into a single `uint64_t` and use the existing large constant desc, al'a `PackOperAndType`. But a separate desc could be considered to be cleaner code. I don't have a strong opinion on this.)

Code after:
        {
            return (GCtype)_idGCref;
        }
        void idGCref(GCtype gctype)
        {
            _idGCref = gctype;
        }

        regNumber idReg1() const
        {
            return _idReg1;
        }
        void idReg1(regNumber reg)
        {
            _idReg1 = reg;
            assert(reg == _idReg1);
        }

#ifdef TARGET_WASM
        bool idIsLclVarDecl() const
        {
            return _idInsFmt == IF_LOCAL_DECL;
        }
#endif

#ifdef TARGET_ARM64
        GCtype idGCrefReg2() const
        {
            assert(!idIsSmallDsc());
            return (GCtype)idAddr()->_idGCref2;
        }
        void idGCrefReg2(GCtype gctype)
        {
            assert(!idIsSmallDsc());
            idAddr()->_idGCref2 = gctype;
        }
#endif // TARGET_ARM64

        regNumber idReg2() const
        {
            return _idReg2;
        }
        void idReg2(regNumber reg)
        {
            _idReg2 = reg;
            assert(reg == _idReg2);
        }

#if defined(TARGET_XARCH)
        regNumber idReg3() const
        {