Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 335a40c65ef21cac7328c5fcff4606d1532cba00..eb72a3d5c10421ea09eee9427344ff29d21d3622 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -8464,6 +8464,7 @@ static bool ShiftAmountsAllowReplaceByRotate(HValue* sa, |
HValue* const32_minus_sa) { |
if (!const32_minus_sa->IsSub()) return false; |
HSub* sub = HSub::cast(const32_minus_sa); |
+ if (sa != sub->right()) return false; |
HValue* const32 = sub->left(); |
if (!const32->IsConstant() || |
HConstant::cast(const32)->Integer32Value() != 32) { |
@@ -8492,6 +8493,7 @@ bool HOptimizedGraphBuilder::MatchRotateRight(HValue* left, |
} else { |
return false; |
} |
+ if (shl->left() != shr->left()) return false; |
if (!ShiftAmountsAllowReplaceByRotate(shl->right(), shr->right()) && |
!ShiftAmountsAllowReplaceByRotate(shr->right(), shl->right())) { |