Skip to content

Commit

Permalink
[LoongArch64] Fix the register conflict of the REG_GSCOOKIE_TMP and…
Browse files Browse the repository at this point in the history
… the `FastTailCall target register`. (#102192)
  • Loading branch information
LuckyXu-HF authored May 15, 2024
1 parent 415ab3a commit 19467dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/jit/lsraloongarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ int LinearScan::BuildCall(GenTreeCall* call)
{
// Fast tail call - make sure that call target is always computed in volatile registers
// that will not be overridden by epilog sequence.
ctrlExprCandidates = allRegs(TYP_INT) & RBM_INT_CALLEE_TRASH;
ctrlExprCandidates = (allRegs(TYP_INT) & (RBM_INT_CALLEE_TRASH & ~RBM_GSCOOKIE_TMP));
assert(ctrlExprCandidates != RBM_NONE);
}
}
Expand All @@ -734,7 +734,7 @@ int LinearScan::BuildCall(GenTreeCall* call)
regMaskTP candidates = RBM_NONE;
if (call->IsFastTailCall())
{
candidates = allRegs(TYP_INT) & RBM_INT_CALLEE_TRASH;
candidates = (allRegs(TYP_INT) & (RBM_INT_CALLEE_TRASH & ~RBM_GSCOOKIE_TMP));
assert(candidates != RBM_NONE);
}

Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/targetloongarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
// Temporary registers used for the GS cookie check.
#define REG_GSCOOKIE_TMP_0 REG_T0
#define REG_GSCOOKIE_TMP_1 REG_T1
#define RBM_GSCOOKIE_TMP (RBM_T0|RBM_T1)

// register to hold shift amount; no special register is required on LOONGARCH64.
#define REG_SHIFT REG_NA
Expand Down

0 comments on commit 19467dc

Please sign in to comment.