Repository: dotnet/runtime
File: src/coreclr/jit/lower.cpp (C++)

Code before:
    GenTreeUnOp* bitCast = comp->gtNewBitCastNode(bitCastType, *argNode);
    BlockRange().InsertAfter(*argNode, bitCast);

    *argNode = bitCast;
    if (!TryRemoveBitCast(bitCast))
    {
        ContainCheckBitCast(bitCast);
    }
}

//------------------------------------------------------------------------
// InsertPutArgReg:
//   Insert a PUTARG_REG node for the specified edge. If the argument node does
//   not fit the register type, then also insert a bitcast.
//
// Arguments:
//    argNode         - Edge for the argument
//    registerSegment - Register that the argument is going into
//
void Lowering::InsertPutArgReg(GenTree** argNode, const ABIPassingSegment& registerSegment)
{
    assert(registerSegment.IsPassedInRegister());

    InsertBitCastIfNecessary(argNode, registerSegment);

#ifdef HAS_FIXED_REGISTER_SET
    GenTree* putArg = comp->gtNewPutArgReg(genActualType(*argNode), *argNode, registerSegment.GetRegister());
    BlockRange().InsertAfter(*argNode, putArg);
    *argNode = putArg;
#endif
}

//------------------------------------------------------------------------
// LowerArgsForCall:
//   Lower the arguments of a call node.
//
// Arguments:
//    call - Call node
//
void Lowering::LowerArgsForCall(GenTreeCall* call)
{
    JITDUMP("Args:\n======\n");
    for (CallArg& arg : call->gtArgs.EarlyArgs())
    {
        LowerArg(call, &arg);
    }

    JITDUMP("\nLate args:\n======\n");
    for (CallArg& arg : call->gtArgs.LateArgs())
    {
        LowerArg(call, &arg);

Review comment (suggestion):
The directive should be `#ifdef` instead of `#if` when checking for the presence of a preprocessor macro. Using `#if` requires the macro to be defined to a non-zero value, while `#ifdef` checks if it's defined at all. If `HAS_FIXED_REGISTER_SET` is intended to be defined as 0 or 1, consider using `#if defined(HAS_FIXED_REGISTER_SET) && HAS_FIXED_REGISTER_SET` for clarity.
```suggestion
#if defined(HAS_FIXED_REGISTER_SET) && HAS_FIXED_REGISTER_SET
```

Code after:
    GenTreeUnOp* bitCast = comp->gtNewBitCastNode(bitCastType, *argNode);
    BlockRange().InsertAfter(*argNode, bitCast);

    *argNode = bitCast;
    if (!TryRemoveBitCast(bitCast))
    {
        ContainCheckBitCast(bitCast);
    }
}

//------------------------------------------------------------------------
// InsertPutArgReg:
//   Insert a PUTARG_REG node for the specified edge. If the argument node does
//   not fit the register type, then also insert a bitcast.
//
// Arguments:
//    argNode         - Edge for the argument
//    registerSegment - Register that the argument is going into
//
void Lowering::InsertPutArgReg(GenTree** argNode, const ABIPassingSegment& registerSegment)
{
    assert(registerSegment.IsPassedInRegister());

    InsertBitCastIfNecessary(argNode, registerSegment);

#if HAS_FIXED_REGISTER_SET
    GenTree* putArg = comp->gtNewPutArgReg(genActualType(*argNode), *argNode, registerSegment.GetRegister());
    BlockRange().InsertAfter(*argNode, putArg);
    *argNode = putArg;
#endif
}

//------------------------------------------------------------------------
// LowerArgsForCall:
//   Lower the arguments of a call node.
//
// Arguments:
//    call - Call node
//
void Lowering::LowerArgsForCall(GenTreeCall* call)
{
    JITDUMP("Args:\n======\n");
    for (CallArg& arg : call->gtArgs.EarlyArgs())
    {
        LowerArg(call, &arg);
    }

    JITDUMP("\nLate args:\n======\n");
    for (CallArg& arg : call->gtArgs.LateArgs())
    {
        LowerArg(call, &arg);