Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo committed Dec 18, 2021
1 parent f4b1ffa commit 58f4f68
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13771,7 +13771,8 @@ GenTree* Compiler::fgOptimizeRelationalComparisonWithCasts(GenTreeOp* tree)
// Caller is expected to call this function only if we have CAST nodes
assert(castedOp->OperIs(GT_CAST) || knownPositiveOp->OperIs(GT_CAST));

if (gtIsActiveCSE_Candidate(tree) || gtIsActiveCSE_Candidate(castedOp) || gtIsActiveCSE_Candidate(knownPositiveOp))
if (optValnumCSE_phase || gtIsActiveCSE_Candidate(tree) || gtIsActiveCSE_Candidate(castedOp) ||
gtIsActiveCSE_Candidate(knownPositiveOp))
{
// We're going to modify all of them
return tree;
Expand Down Expand Up @@ -13801,7 +13802,7 @@ GenTree* Compiler::fgOptimizeRelationalComparisonWithCasts(GenTreeOp* tree)
}

if (castedOp->OperIs(GT_CAST) && varTypeIsLong(castedOp->CastToType()) && castedOp->gtGetOp1()->TypeIs(TYP_INT) &&
castedOp->IsUnsigned())
castedOp->IsUnsigned() && !castedOp->gtOverflow())
{
bool knownPositiveFitsIntoU32 = false;
if (knownPositiveOp->IsIntegralConst() &&
Expand Down Expand Up @@ -13860,7 +13861,12 @@ GenTree* Compiler::fgOptimizeRelationalComparisonWithCasts(GenTreeOp* tree)
assert(knownPositiveOp->OperIs(GT_CNS_LNG));
knownPositiveOp->ChangeOperUnchecked(GT_CNS_INT);
#endif
fgUpdateConstTreeValueNumber(knownPositiveOp);
}

tree->gtGetOp1()->SetAllEffectsFlags(tree);
tree->gtGetOp2()->SetAllEffectsFlags(tree);

DISPTREE(tree)
JITDUMP("\n")
}
Expand Down

0 comments on commit 58f4f68

Please sign in to comment.