Skip to content
Merged
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
15 changes: 4 additions & 11 deletions src/coreclr/jit/codegenloongarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ void CodeGen::genFnEpilog(BasicBlock* block)

compiler->unwindBegEpilog();

genPopCalleeSavedRegisters();

if (jmpEpilog)
{
SetHasTailCalls(true);
Expand All @@ -644,7 +646,6 @@ void CodeGen::genFnEpilog(BasicBlock* block)
#if !FEATURE_FASTTAILCALL
noway_assert(jmpNode->OperIs(GT_JMP));
#else // FEATURE_FASTTAILCALL
// armarch
// If jmpNode is GT_JMP then gtNext must be null.
// If jmpNode is a fast tail call, gtNext need not be null since it could have embedded stmts.
noway_assert(!jmpNode->OperIs(GT_JMP) || (jmpNode->gtNext == nullptr));
Expand Down Expand Up @@ -699,28 +700,20 @@ void CodeGen::genFnEpilog(BasicBlock* block)
NO_WAY("Unsupported JMP indirection");
}

/* Simply emit a jump to the methodHnd. This is similar to a call so we can use
* the same descriptor with some minor adjustments.
*/

genPopCalleeSavedRegisters(true);

// Simply emit a jump to the methodHnd. This is similar to a call so we can use
// the same descriptor with some minor adjustments.
params.isJump = true;

genEmitCallWithCurrentGC(params);
}
#if FEATURE_FASTTAILCALL
else
{
genPopCalleeSavedRegisters(true);
genCallInstruction(jmpNode->AsCall());
}
#endif // FEATURE_FASTTAILCALL
}
else
{
genPopCalleeSavedRegisters(false);

GetEmitter()->emitIns_R_R_I(INS_jirl, EA_PTRSIZE, REG_R0, REG_RA, 0);
compiler->unwindReturn(REG_RA);
}
Expand Down
Loading