Skip to content

Commit

Permalink
follow up to #52524 (#52714)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored May 17, 2021
1 parent d5668e7 commit dd8b090
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 @@ -14091,7 +14091,8 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac)
}

// Fold "cmp & 1" to just "cmp"
if (tree->OperIs(GT_AND) && tree->TypeIs(TYP_INT) && op1->OperIsCompare() && op2->IsIntegralConst(1))
if (tree->OperIs(GT_AND) && tree->TypeIs(TYP_INT) && op1->OperIsCompare() && op2->IsIntegralConst(1) &&
!gtIsActiveCSE_Candidate(tree) && !gtIsActiveCSE_Candidate(op2))
{
DEBUG_DESTROY_NODE(op2);
DEBUG_DESTROY_NODE(tree);
Expand Down

0 comments on commit dd8b090

Please sign in to comment.