Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix putArgStk dstCount and ConsumeReg errors #8928

Merged
merged 1 commit into from
Jan 12, 2017
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
9 changes: 5 additions & 4 deletions src/jit/codegenarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1918,6 +1918,10 @@ void CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
emitter* emit = getEmitter();

#ifdef DEBUG
// Validate that all the operands for the current node are consumed in order.
// This is important because LSRA ensures that any necessary copies will be
// handled correctly.
lastConsumedNode = nullptr;
if (compiler->verbose)
{
unsigned seqNum = treeNode->gtSeqNum; // Useful for setting a conditional break in Visual Studio
Expand Down Expand Up @@ -2262,7 +2266,6 @@ void CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
else
{
assert(!data->isContained());
genConsumeReg(data);
dataReg = data->gtRegNum;
}
assert(dataReg != REG_NA);
Expand Down Expand Up @@ -2314,7 +2317,6 @@ void CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
else
{
assert(!data->isContained());
genConsumeReg(data);
dataReg = data->gtRegNum;
}
assert(dataReg != REG_NA);
Expand Down Expand Up @@ -4118,12 +4120,11 @@ void CodeGen::genCodeForShift(GenTreePtr tree)
assert(tree->gtRegNum != REG_NA);

GenTreePtr operand = tree->gtGetOp1();
genConsumeReg(operand);
genConsumeOperands(tree->AsOp());

GenTreePtr shiftBy = tree->gtGetOp2();
if (!shiftBy->IsCnsIntOrI())
{
genConsumeReg(shiftBy);
getEmitter()->emitIns_R_R_R(ins, size, tree->gtRegNum, operand->gtRegNum, shiftBy->gtRegNum);
}
else
Expand Down
1 change: 0 additions & 1 deletion src/jit/emitarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10892,7 +10892,6 @@ void emitter::emitInsLoadStoreOp(instruction ins, emitAttr attr, regNumber dataR
}
else // addr is not contained, so we evaluate it into a register
{
codeGen->genConsumeReg(addr);
// Then load/store dataReg from/to [addrReg]
emitIns_R_R(ins, ldstAttr, dataReg, addr->gtRegNum);
}
Expand Down
2 changes: 1 addition & 1 deletion src/jit/lowerarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ void Lowering::TreeNodeInfoInit(GenTree* tree)
case GT_CNS_INT:
case GT_PUTARG_REG:
case GT_PUTARG_STK:
info->dstCount = (tree->TypeGet() == TYP_VOID) ? 0 : 1;
info->dstCount = tree->IsValue() ? 1 : 0;
if (kind & (GTK_CONST | GTK_LEAF))
{
info->srcCount = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/jit/lowerarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void Lowering::TreeNodeInfoInit(GenTree* tree)
GenTree* op2;

default:
info->dstCount = (tree->TypeGet() == TYP_VOID) ? 0 : 1;
info->dstCount = tree->IsValue() ? 1 : 0;
if (kind & (GTK_CONST | GTK_LEAF))
{
info->srcCount = 0;
Expand Down