File tree 1 file changed +10
-4
lines changed 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -8155,23 +8155,29 @@ 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:
8158
8160
consumedRegs |= genRegMask(op->GetRegNum());
8159
8161
8160
8162
if (op->OperIs(GT_COPY))
8161
8163
{
8162
8164
GenTree* srcOp = op->gtGetOp1();
8163
8165
consumedRegs |= genRegMask(srcOp->GetRegNum());
8164
8166
}
8165
-
8166
- if (op->IsLocal())
8167
+ else if (op->IsLocal())
8167
8168
{
8168
8169
GenTreeLclVarCommon* lcl = op->AsLclVarCommon();
8169
8170
terminatorNodeLclVarDsc = &compiler->lvaTable[lcl->GetLclNum()];
8170
8171
}
8171
8172
8173
+ if (!lastNode->gtGetOp2()->isContainedIntOrIImmed() && (op != lastNode->gtGetOp2()))
8174
+ {
8175
+ op = lastNode->gtGetOp2();
8176
+ goto Consume_Op2;
8177
+ }
8178
+
8172
8179
#if !defined(TARGET_LOONGARCH64) && !defined(TARGET_RISCV64)
8173
- // TODO-LOONGARCH64: Take into account that on LA64, the second
8174
- // operand of a JCMP can be in a register too.
8180
+ // For LoongArch64/RISC-V, the second operand of a JCMP can be in a register too.
8175
8181
assert(!lastNode->OperIs(GT_JCMP, GT_JTEST) || lastNode->gtGetOp2()->isContained());
8176
8182
#endif
8177
8183
}
You can’t perform that action at this time.
0 commit comments