Skip to content

Commit

Permalink
[LoongArch64] Synchronize with PR#102592. (#102711)
Browse files Browse the repository at this point in the history
* Fix the build error for LA64.
  • Loading branch information
LuckyXu-HF authored May 28, 2024
1 parent 9daa4b4 commit 8f2f3da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/jit/lsrabuild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3303,7 +3303,7 @@ void LinearScan::BuildDefWithKills(GenTree* tree, int dstCount, SingleTypeRegSet
}
#endif // TARGET_64BIT
}
#endif // defined(TARGET_ARMARCH) || defined(TARGET_RISCV64)
#endif // defined(TARGET_ARMARCH) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64)

//------------------------------------------------------------------------
// BuildCallDefsWithKills: Build one or more RefTypeDef RefPositions for the given node,
Expand Down
18 changes: 10 additions & 8 deletions src/coreclr/jit/lsraloongarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ int LinearScan::BuildCall(GenTreeCall* call)
{
bool hasMultiRegRetVal = false;
const ReturnTypeDesc* retTypeDesc = nullptr;
regMaskTP singleDstCandidates = RBM_NONE;
SingleTypeRegSet singleDstCandidates = RBM_NONE;

int srcCount = 0;
int dstCount = 0;
Expand All @@ -700,8 +700,8 @@ int LinearScan::BuildCall(GenTreeCall* call)
}
}

GenTree* ctrlExpr = call->gtControlExpr;
regMaskTP ctrlExprCandidates = RBM_NONE;
GenTree* ctrlExpr = call->gtControlExpr;
SingleTypeRegSet ctrlExprCandidates = RBM_NONE;
if (call->gtCallType == CT_INDIRECT)
{
// either gtControlExpr != null or gtCallAddr != null.
Expand Down Expand Up @@ -731,7 +731,7 @@ int LinearScan::BuildCall(GenTreeCall* call)
{
// For R2R and VSD we have stub address in REG_R2R_INDIRECT_PARAM
// and will load call address into the temp register from this register.
regMaskTP candidates = RBM_NONE;
SingleTypeRegSet candidates = RBM_NONE;
if (call->IsFastTailCall())
{
candidates = (allRegs(TYP_INT) & (RBM_INT_CALLEE_TRASH & ~RBM_GSCOOKIE_TMP));
Expand Down Expand Up @@ -994,14 +994,16 @@ int LinearScan::BuildPutArgSplit(GenTreePutArgSplit* argNode)
// Registers for split argument corresponds to source
int dstCount = argNode->gtNumRegs;

regNumber argReg = argNode->GetRegNum();
regMaskTP argMask = RBM_NONE;
regNumber argReg = argNode->GetRegNum();
SingleTypeRegSet argMask = RBM_NONE;
for (unsigned i = 0; i < argNode->gtNumRegs; i++)
{
regNumber thisArgReg = (regNumber)((unsigned)argReg + i);
argMask |= genRegMask(thisArgReg);
argNode->SetRegNumByIdx(thisArgReg, i);
}
assert((argMask == RBM_NONE) || ((argMask & availableIntRegs) != RBM_NONE) ||
((argMask & availableFloatRegs) != RBM_NONE));

if (putArgChild->OperGet() == GT_FIELD_LIST)
{
Expand All @@ -1023,7 +1025,7 @@ int LinearScan::BuildPutArgSplit(GenTreePutArgSplit* argNode)

// Consume all the registers, setting the appropriate register mask for the ones that
// go into registers.
regMaskTP sourceMask = RBM_NONE;
SingleTypeRegSet sourceMask = RBM_NONE;
if (sourceRegCount < argNode->gtNumRegs)
{
sourceMask = genRegMask((regNumber)((unsigned)argReg + sourceRegCount));
Expand Down Expand Up @@ -1138,7 +1140,7 @@ int LinearScan::BuildBlockStore(GenTreeBlk* blkNode)
// We don't need to materialize the struct size but we still need
// a temporary register to perform the sequence of loads and stores.
// We can't use the special Write Barrier registers, so exclude them from the mask
regMaskTP internalIntCandidates =
SingleTypeRegSet internalIntCandidates =
allRegs(TYP_INT) & ~(RBM_WRITE_BARRIER_DST_BYREF | RBM_WRITE_BARRIER_SRC_BYREF);
buildInternalIntRegisterDefForNode(blkNode, internalIntCandidates);

Expand Down

0 comments on commit 8f2f3da

Please sign in to comment.