File tree 1 file changed +13
-9
lines changed 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -8155,8 +8155,6 @@ void LinearScan::handleOutgoingCriticalEdges(BasicBlock* block)
8155
8155
if (lastNode->OperIs(GT_JTRUE, GT_JCMP, GT_JTEST))
8156
8156
{
8157
8157
GenTree* op = lastNode->gtGetOp1();
8158
-
8159
- Consume_Op2:
8160
8158
consumedRegs |= genRegMask(op->GetRegNum());
8161
8159
8162
8160
if (op->OperIs(GT_COPY))
@@ -8170,16 +8168,22 @@ void LinearScan::handleOutgoingCriticalEdges(BasicBlock* block)
8170
8168
terminatorNodeLclVarDsc = &compiler->lvaTable[lcl->GetLclNum()];
8171
8169
}
8172
8170
8173
- if (! lastNode->gtGetOp2()->isContainedIntOrIImmed() && (op != lastNode->gtGetOp2()))
8171
+ if (lastNode->OperIs(GT_JCMP, GT_JTEST) && ! lastNode->gtGetOp2()->isContained( ))
8174
8172
{
8175
8173
op = lastNode->gtGetOp2();
8176
- goto Consume_Op2;
8177
- }
8174
+ consumedRegs |= genRegMask(op->GetRegNum());
8178
8175
8179
- #if !defined(TARGET_LOONGARCH64) && !defined(TARGET_RISCV64)
8180
- // For LoongArch64/RISC-V, the second operand of a JCMP can be in a register too.
8181
- assert(!lastNode->OperIs(GT_JCMP, GT_JTEST) || lastNode->gtGetOp2()->isContained());
8182
- #endif
8176
+ if (op->OperIs(GT_COPY))
8177
+ {
8178
+ GenTree* srcOp = op->gtGetOp1();
8179
+ consumedRegs |= genRegMask(srcOp->GetRegNum());
8180
+ }
8181
+ else if (op->IsLocal())
8182
+ {
8183
+ GenTreeLclVarCommon* lcl = op->AsLclVarCommon();
8184
+ terminatorNodeLclVarDsc = &compiler->lvaTable[lcl->GetLclNum()];
8185
+ }
8186
+ }
8183
8187
}
8184
8188
}
8185
8189
You can’t perform that action at this time.
0 commit comments