Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4950,14 +4950,6 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
// call and register argument info, flowgraph and loop info, etc.
compJitStats();

#ifdef TARGET_ARM
if (compLocallocUsed)
{
// We reserve REG_SAVED_LOCALLOC_SP to store SP on entry for stack unwinding
codeGen->regSet.rsMaskResvd |= RBM_SAVED_LOCALLOC_SP;
}
#endif // TARGET_ARM

if (compIsAsync())
{
DoPhase(this, PHASE_ASYNC, &Compiler::TransformAsync);
Expand Down
10 changes: 10 additions & 0 deletions src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2717,6 +2717,16 @@ void LinearScan::setFrameType()
}
#endif // TARGET_ARMARCH || TARGET_RISCV64

#ifdef TARGET_ARM
if (compiler->compLocallocUsed)
{
// We reserve REG_SAVED_LOCALLOC_SP to store SP on entry for stack unwinding
compiler->codeGen->regSet.rsMaskResvd |= RBM_SAVED_LOCALLOC_SP;
Comment on lines +2723 to +2724
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a JITDUMP like the one above about the fact that we are reserving this register?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Can you add a JITDUMP like the one above about the fact that we are reserving this register?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 8da758e

JITDUMP(" Reserved REG_SAVED_LOCALLOC_SP (%s) due to localloc\n", getRegName(REG_SAVED_LOCALLOC_SP));
removeMask |= RBM_SAVED_LOCALLOC_SP.GetIntRegSet();
}
#endif // TARGET_ARM

if ((removeMask != RBM_NONE) && ((availableIntRegs & removeMask) != 0))
{
// We know that we're already in "read mode" for availableIntRegs. However,
Expand Down
Loading