Index: src/compiler/simplified-lowering.cc |
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc |
index b3050719883c0467bf97f8d0610e494a3142c014..6f3d835ff6e9906a7cc5930a7f26840721a5bb84 100644 |
--- a/src/compiler/simplified-lowering.cc |
+++ b/src/compiler/simplified-lowering.cc |
@@ -324,7 +324,8 @@ class RepresentationSelector { |
} else if (upper->Is(Type::Signed32()) || upper->Is(Type::Unsigned32())) { |
// multiple uses, but we are within 32 bits range => pick kRepWord32. |
return kRepWord32; |
- } else if ((use & kRepMask) == kRepWord32 || |
+ } else if (((use & kRepMask) == kRepWord32 && |
+ !CanObserveNonWord32(use)) || |
(use & kTypeMask) == kTypeInt32 || |
(use & kTypeMask) == kTypeUint32) { |
// We only use 32 bits or we use the result consistently. |
@@ -451,6 +452,10 @@ class RepresentationSelector { |
!CanObserveNonUint32(use); |
} |
+ bool CanObserveNonWord32(MachineTypeUnion use) { |
+ return (use & ~(kTypeUint32 | kTypeInt32)) != 0; |
+ } |
+ |
bool CanObserveNonInt32(MachineTypeUnion use) { |
return (use & (kTypeUint32 | kTypeNumber | kTypeAny)) != 0; |
} |