Skip to content
Merged
Show file tree
Hide file tree
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: 6 additions & 9 deletions src/coreclr/src/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ void CodeGen::genMultiRegStoreToLocal(GenTree* treeNode)
GenTree* op1 = treeNode->gtGetOp1();
GenTree* actualOp1 = op1->gtSkipReloadOrCopy();
assert(op1->IsMultiRegNode());
unsigned regCount = op1->GetMultiRegCount();
unsigned regCount = actualOp1->GetMultiRegCount();

// Assumption: current implementation requires that a multi-reg
// var in 'var = call' is flagged as lvIsMultiRegRet to prevent it from
Expand Down Expand Up @@ -1444,17 +1444,14 @@ void CodeGen::genMultiRegStoreToLocal(GenTree* treeNode)
{
for (unsigned i = 0; i < regCount; ++i)
{
var_types type = op1->gtSkipReloadOrCopy()->GetRegTypeByIndex(i);
var_types type = actualOp1->GetRegTypeByIndex(i);
regNumber reg = op1->GetRegByIndex(i);
if (op1->IsCopyOrReload())
if (reg == REG_NA)
{
// GT_COPY/GT_RELOAD will have valid reg for those positions
// GT_COPY/GT_RELOAD will have valid reg only for those positions
// that need to be copied or reloaded.
regNumber reloadReg = op1->AsCopyOrReload()->GetRegNumByIdx(i);
if (reloadReg != REG_NA)
{
reg = reloadReg;
}
assert(op1->IsCopyOrReload());
reg = actualOp1->GetRegByIndex(i);
}

assert(reg != REG_NA);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11779,7 +11779,7 @@ void CodeGen::genRegCopy(GenTree* treeNode)
GenTreeCopyOrReload* copyNode = treeNode->AsCopyOrReload();
unsigned regCount = copyNode->GetRegCount();
// GenTreeCopyOrReload only reports the number of registers that are valid.
assert(regCount <= 2);
assert(regCount <= MAX_MULTIREG_COUNT);

// First set the source registers as busy if they haven't been spilled.
// (Note that this is just for verification that we don't have circular dependencies.)
Expand Down
15 changes: 6 additions & 9 deletions src/coreclr/src/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,7 @@ void CodeGen::genMultiRegStoreToLocal(GenTree* treeNode)
GenTree* op1 = treeNode->gtGetOp1();
GenTree* actualOp1 = op1->gtSkipReloadOrCopy();
assert(op1->IsMultiRegNode());
unsigned regCount = op1->GetMultiRegCount();
unsigned regCount = actualOp1->GetMultiRegCount();

// Assumption: The current implementation requires that a multi-reg
// var in 'var = call' is flagged as lvIsMultiRegRet to prevent it from
Expand Down Expand Up @@ -1968,17 +1968,14 @@ void CodeGen::genMultiRegStoreToLocal(GenTree* treeNode)
int offset = 0;
for (unsigned i = 0; i < regCount; ++i)
{
var_types type = op1->gtSkipReloadOrCopy()->GetRegTypeByIndex(i);
var_types type = actualOp1->GetRegTypeByIndex(i);
regNumber reg = op1->GetRegByIndex(i);
if (op1->IsCopyOrReload())
if (reg == REG_NA)
{
// GT_COPY/GT_RELOAD will have valid reg for those positions
// GT_COPY/GT_RELOAD will have valid reg only for those positions
// that need to be copied or reloaded.
regNumber reloadReg = op1->AsCopyOrReload()->GetRegNumByIdx(i);
if (reloadReg != REG_NA)
{
reg = reloadReg;
}
assert(op1->IsCopyOrReload());
reg = actualOp1->GetRegByIndex(i);
}

assert(reg != REG_NA);
Expand Down