Skip to content

Commit

Permalink
JIT: Add missing case to relational with constant optimization (#79541)
Browse files Browse the repository at this point in the history
Almost all cases of #11349 were fixed, except for this missing one.

Fix #11349
  • Loading branch information
jakobbotsch authored Dec 12, 2022
1 parent bf9fc46 commit fdd1f63
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10975,7 +10975,8 @@ GenTree* Compiler::fgOptimizeRelationalComparisonWithFullRangeConst(GenTreeOp* c
ret = gtNewZeroConNode(TYP_INT);
}
// [x0, x1] < [y0, y1] is true if x1 < y0
else if ((op == GT_LT) && (lhsMax < rhsMin))
// [x0, x1] <= [y0, y1] is true if x1 <= y0
else if (((op == GT_LT) && (lhsMax < rhsMin)) || ((op == GT_LE) && (lhsMax <= rhsMin)))
{
ret = gtNewOneConNode(TYP_INT);
}
Expand Down

0 comments on commit fdd1f63

Please sign in to comment.