Skip to content

JIT ARM32: LSRA does not kill R2R indirection cell reg on calls using it #70552

@jakobbotsch

Description

@jakobbotsch

On ARM32 VSD calls and R2R calls pass an indirection cell in R4 which is a callee-saved register. This is unlike other platforms where a volatile register is used instead. Because of this there has to be special handling in getKillSetForCall, but currently we only have such handling for VSD calls:

#ifdef TARGET_ARM
if (call->IsVirtualStub())
{
killMask |= compiler->virtualStubParamInfo->GetRegMask();
}
#else // !TARGET_ARM

We work around this issue in morph by locking in the register requirement on the node itself and marking the constant as no-CSE:

indirectCellAddress->SetRegNum(REG_R2R_INDIRECT_PARAM);
#ifdef TARGET_ARM
// Issue #xxxx : Don't attempt to CSE this constant on ARM32
//
// This constant has specific register requirements, and LSRA doesn't currently correctly
// handle them when the value is in a CSE'd local.
indirectCellAddress->SetDoNotCSE();
#endif // TARGET_ARM

When I have tried fixing the problem and removing the morph workaround I have seen som large-ish crossgen ARM regressions, so some more investigation is needed.

category:correctness
theme:register-allocator

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-arm32area-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