Skip to content

Commit

Permalink
[LoongArch64] The REG_SCRATCH is not conflict with REG_PINVOKE_FRAME. (
Browse files Browse the repository at this point in the history
…#88029)

* [LoongArch64] The REG_SCRATCH is not conflict with REG_PINVOKE_FRAME.

* amend the comment for CR.
  • Loading branch information
shushanhf authored Jun 27, 2023
1 parent 7bad200 commit 19d2e90
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5774,17 +5774,13 @@ void CodeGen::genFnProlog()
{
initReg = REG_IP1;
}
#elif defined(TARGET_LOONGARCH64)
// For loongarch64 OSR root frames, we may need a scratch register for large
// offset addresses. Use a register that won't be allocated.
//
if (isRoot && compiler->opts.IsOSR())
{
initReg = REG_SCRATCH;
}
#endif

#ifndef TARGET_LOONGARCH64
// For LoongArch64's OSR root frames, we may need a scratch register for large
// offset addresses. But this does not conflict with the REG_PINVOKE_FRAME.
noway_assert(!compiler->compMethodRequiresPInvokeFrame() || (initReg != REG_PINVOKE_FRAME));
#endif

#if defined(TARGET_AMD64)
// If we are a varargs call, in order to set up the arguments correctly this
Expand Down

0 comments on commit 19d2e90

Please sign in to comment.