summaryrefslogtreecommitdiff
path: root/src/jit/codegenarm64.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jit/codegenarm64.cpp')
-rw-r--r--src/jit/codegenarm64.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/jit/codegenarm64.cpp b/src/jit/codegenarm64.cpp
index cc7c5dc..71c6dd1 100644
--- a/src/jit/codegenarm64.cpp
+++ b/src/jit/codegenarm64.cpp
@@ -1326,7 +1326,7 @@ void CodeGen::genEmitGSCookieCheck(bool pushReg)
genDefineTempLabel(gsCheckBlk);
}
-BasicBlock* CodeGen::genCallFinally(BasicBlock* block, BasicBlock* lblk)
+BasicBlock* CodeGen::genCallFinally(BasicBlock* block)
{
// Generate a call to the finally, like this:
// mov x0,qword ptr [fp + 10H] / sp // Load x0 with PSPSym, or sp if PSPSym is not used
@@ -1387,8 +1387,6 @@ BasicBlock* CodeGen::genCallFinally(BasicBlock* block, BasicBlock* lblk)
if (!(block->bbFlags & BBF_RETLESS_CALL))
{
assert(block->isBBCallAlwaysPair());
-
- lblk = block;
block = block->bbNext;
}
return block;
@@ -1918,6 +1916,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
@@ -2262,7 +2264,6 @@ void CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
else
{
assert(!data->isContained());
- genConsumeReg(data);
dataReg = data->gtRegNum;
}
assert(dataReg != REG_NA);
@@ -2314,7 +2315,6 @@ void CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
else
{
assert(!data->isContained());
- genConsumeReg(data);
dataReg = data->gtRegNum;
}
assert(dataReg != REG_NA);
@@ -2423,8 +2423,8 @@ void CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
var_types op1Type = op1->TypeGet();
var_types op2Type = op2->TypeGet();
- assert(!op1->isContainedMemoryOp());
- assert(!op2->isContainedMemoryOp());
+ assert(!op1->isUsedFromMemory());
+ assert(!op2->isUsedFromMemory());
genConsumeOperands(tree);
@@ -3798,8 +3798,8 @@ void CodeGen::genRangeCheck(GenTreePtr oper)
GenTree * src1, *src2;
emitJumpKind jmpKind;
- genConsumeRegs(arrLen);
genConsumeRegs(arrIndex);
+ genConsumeRegs(arrLen);
if (arrIndex->isContainedIntOrIImmed())
{
@@ -3951,14 +3951,14 @@ void CodeGen::genCodeForArrOffset(GenTreeArrOffs* arrOffset)
if (!offsetNode->IsIntegralConst(0))
{
- emitter* emit = getEmitter();
- GenTreePtr arrObj = arrOffset->gtArrObj;
- regNumber arrReg = genConsumeReg(arrObj);
- noway_assert(arrReg != REG_NA);
+ emitter* emit = getEmitter();
regNumber offsetReg = genConsumeReg(offsetNode);
noway_assert(offsetReg != REG_NA);
regNumber indexReg = genConsumeReg(indexNode);
noway_assert(indexReg != REG_NA);
+ GenTreePtr arrObj = arrOffset->gtArrObj;
+ regNumber arrReg = genConsumeReg(arrObj);
+ noway_assert(arrReg != REG_NA);
regMaskTP tmpRegMask = arrOffset->gtRsvdRegs;
regNumber tmpReg = genRegNumFromMask(tmpRegMask);
noway_assert(tmpReg != REG_NA);
@@ -4118,12 +4118,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