Index: src/compiler/simplified-lowering.cc |
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc |
index c50b338ee1656691c27f0985b49ad958813f4524..33a3077a1c0b90ef3e02a9870b0fd734b9e2e70e 100644 |
--- a/src/compiler/simplified-lowering.cc |
+++ b/src/compiler/simplified-lowering.cc |
@@ -672,8 +672,11 @@ class RepresentationSelector { |
VisitUnop(node, kTypeInt32 | use_rep, kTypeInt32 | use_rep); |
if (lower()) DeferReplacement(node, node->InputAt(0)); |
} else if ((in & kTypeMask) == kTypeUint32 || |
- (in & kTypeMask) == kTypeInt32 || |
- in_upper->Is(Type::Unsigned32()) || |
+ in_upper->Is(Type::Unsigned32())) { |
+ // Just change representation if necessary. |
+ VisitUnop(node, kTypeUint32 | kRepWord32, kTypeInt32 | kRepWord32); |
+ if (lower()) DeferReplacement(node, node->InputAt(0)); |
+ } else if ((in & kTypeMask) == kTypeInt32 || |
(in & kRepMask) == kRepWord32) { |
// Just change representation if necessary. |
VisitUnop(node, kTypeInt32 | kRepWord32, kTypeInt32 | kRepWord32); |
@@ -697,12 +700,15 @@ class RepresentationSelector { |
VisitUnop(node, kTypeUint32 | use_rep, kTypeUint32 | use_rep); |
if (lower()) DeferReplacement(node, node->InputAt(0)); |
} else if ((in & kTypeMask) == kTypeUint32 || |
- (in & kTypeMask) == kTypeInt32 || |
- in_upper->Is(Type::Signed32()) || |
- (in & kRepMask) == kRepWord32) { |
+ in_upper->Is(Type::Unsigned32())) { |
// Just change representation if necessary. |
VisitUnop(node, kTypeUint32 | kRepWord32, kTypeUint32 | kRepWord32); |
if (lower()) DeferReplacement(node, node->InputAt(0)); |
+ } else if ((in & kTypeMask) == kTypeInt32 || |
+ (in & kRepMask) == kRepWord32) { |
+ // Just change representation if necessary. |
+ VisitUnop(node, kTypeInt32 | kRepWord32, kTypeUint32 | kRepWord32); |
+ if (lower()) DeferReplacement(node, node->InputAt(0)); |
} else { |
// Require the input in float64 format and perform truncation. |
// TODO(turbofan): avoid a truncation with a smi check. |