Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the regs conflicts within the addResolution for LoongArch64 and RISC-V. #86294

Merged
merged 3 commits into from
May 17, 2023
Merged
Changes from 2 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
24 changes: 17 additions & 7 deletions src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8162,18 +8162,28 @@ void LinearScan::handleOutgoingCriticalEdges(BasicBlock* block)
GenTree* srcOp = op->gtGetOp1();
consumedRegs |= genRegMask(srcOp->GetRegNum());
}

if (op->IsLocal())
else if (op->IsLocal())
{
GenTreeLclVarCommon* lcl = op->AsLclVarCommon();
terminatorNodeLclVarDsc = &compiler->lvaTable[lcl->GetLclNum()];
}

#if !defined(TARGET_LOONGARCH64) && !defined(TARGET_RISCV64)
// TODO-LOONGARCH64: Take into account that on LA64, the second
// operand of a JCMP can be in a register too.
assert(!lastNode->OperIs(GT_JCMP, GT_JTEST) || lastNode->gtGetOp2()->isContained());
#endif
if (lastNode->OperIs(GT_JCMP, GT_JTEST) && !lastNode->gtGetOp2()->isContained())
{
op = lastNode->gtGetOp2();
consumedRegs |= genRegMask(op->GetRegNum());

if (op->OperIs(GT_COPY))
{
GenTree* srcOp = op->gtGetOp1();
consumedRegs |= genRegMask(srcOp->GetRegNum());
}
else if (op->IsLocal())
{
GenTreeLclVarCommon* lcl = op->AsLclVarCommon();
terminatorNodeLclVarDsc = &compiler->lvaTable[lcl->GetLclNum()];
shushanhf marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}

Expand Down