gtSetEvalOrder already does this. And even if it doesn't it's not the job of genCompareInt to swap operands, that should happen in LowerCompare.
Attempting to do this in LowerCompare resulted in 0 diffs.
genConsumeOperands(tree);
- // TODO-CQ: We should be able to support swapping op1 and op2 to generate cmp reg, imm.
- // https://github.com/dotnet/coreclr/issues/7270
- assert(!op1->isContainedIntOrIImmed()); // We no longer support
+ assert(!op1->isContainedIntOrIImmed());
assert(!varTypeIsFloating(op2Type));
instruction ins;
}
else if (op1->IsCnsIntOrI())
{
- // TODO-CQ: We should be able to support swapping op1 and op2 to generate cmp reg, imm,
- // but there is currently an assert in CodeGen::genCompareInt().
- // https://github.com/dotnet/coreclr/issues/7270
SetRegOptional(op2);
}
else