Skip to content

Commit

Permalink
Fix morph issue with fgOptimizeEqualityComparisonWithConst (#78187)
Browse files Browse the repository at this point in the history
* Fix morph issue with fgOptimizeEqualityComparisonWithConst
- On arm32 a shift of a long requires a helper call, but the optimization in fgOptimizeEqualityComparisonWithConst for converting a right shift into a left shift was not keeping the GTF_CALL flag on the GenTree node.

* Update src/coreclr/jit/morph.cpp

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
  • Loading branch information
davidwrighton and SingleAccretion committed Nov 11, 2022
1 parent 78322ae commit 7db5a57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11476,8 +11476,8 @@ GenTree* Compiler::fgOptimizeEqualityComparisonWithConst(GenTreeOp* cmp)
rshiftOp->gtOp1 = andOp->gtGetOp2();
andOp->gtOp2 = rshiftOp;

rshiftOp->SetAllEffectsFlags(rshiftOp->gtGetOp1(), rshiftOp->gtGetOp2());
rshiftOp->SetOper(GT_LSH);
gtUpdateNodeSideEffects(rshiftOp);
}

// Reverse the condition if necessary.
Expand Down

0 comments on commit 7db5a57

Please sign in to comment.