Skip to content

Commit

Permalink
Add GT_EQ check(#61412)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkiFoD committed Mar 15, 2022
1 parent f64a8ac commit 175bac2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2928,10 +2928,10 @@ GenTree* Lowering::OptimizeConstCompare(GenTree* cmp)
// Optimizes (X & 1) == 1 to (X & 1)
// The compiler requires jumps to have relop operands, so we do not fold that case.
LIR::Use cmpUse;
if ((op2Value == 1) && BlockRange().TryGetUse(cmp, &cmpUse))
if ((op2Value == 1) && cmp->OperIs(GT_EQ))
{
if (andOp2->IsIntegralConst(1) && (genActualType(op1) == cmp->TypeGet()) &&
!cmpUse.User()->OperIs(GT_JTRUE))
BlockRange().TryGetUse(cmp, &cmpUse) && !cmpUse.User()->OperIs(GT_JTRUE))
{
GenTree* next = cmp->gtNext;

Expand Down

0 comments on commit 175bac2

Please sign in to comment.