JIT: Transform '(cmp & x) | (cmp & y)' to 'cmp & (x | y)'#126070
JIT: Transform '(cmp & x) | (cmp & y)' to 'cmp & (x | y)'#126070BoyBaykiller wants to merge 2 commits intodotnet:mainfrom
Conversation
| Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
| I am having a problem identifying certain cases. Which works fine for When adding explicit parentheses like But this shouldn't be needed. It shouldnt get confused by some extra commutative arithmetic like the ADD(1) here. What is the general way to fix this? |
The operator priority of |
| // Fold "(cmp & x) | (cmp & y)" to "cmp & (x | y)". | ||
| if (varTypeIsIntegralOrI(orOp) && op1->OperIs(GT_AND) && op2->OperIs(GT_AND)) | ||
| { | ||
| if (GenTree::Compare(op1->gtGetOp1(), op2->gtGetOp1())) |
There was a problem hiding this comment.
I don't think this is legal - cmp may have side-effect or be a local whose value is changed via x or y
No description provided.