Chromium Code Reviews| Index: src/compiler/simplified-lowering.cc |
| diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc |
| index cc226447c21542b22e69689c1f119e2410180c6e..96ca2a273b7d249e1ecb3bbe978f123d024bc799 100644 |
| --- a/src/compiler/simplified-lowering.cc |
| +++ b/src/compiler/simplified-lowering.cc |
| @@ -1124,20 +1124,12 @@ class RepresentationSelector { |
| if (BothInputsAre(node, Type::PlainPrimitive())) { |
| if (truncation.IsUnused()) return VisitUnused(node); |
| } |
| - if (BothInputsAre(node, Type::Signed32OrMinusZero()) && |
| - NodeProperties::GetType(node)->Is(Type::Signed32())) { |
| - // int32 + int32 = int32 ==> signed Int32Add/Sub |
| - VisitInt32Binop(node); |
| - if (lower()) ChangeToPureOp(node, Int32Op(node)); |
| - return; |
| - } |
| - |
| - // Use truncation if available. |
| if (BothInputsAre(node, type_cache_.kAdditiveSafeIntegerOrMinusZero) && |
| - truncation.IsUsedAsWord32()) { |
| - // safe-int + safe-int = x (truncated to int32) |
| - // => signed Int32Add/Sub (truncated) |
| - VisitWord32TruncatingBinop(node); |
| + (GetUpperBound(node)->Is(Type::Signed32()) || |
| + GetUpperBound(node)->Is(Type::Unsigned32()) || |
| + truncation.IsUsedAsWord32())) { |
| + // => Int32Add/Sub |
| + VisitInt32Binop(node); |
|
Jarin
2016/08/19 08:41:07
Use VisitWord32TuncatingBinop here, please.
(Even
Benedikt Meurer
2016/08/19 09:16:02
Done.
|
| if (lower()) ChangeToPureOp(node, Int32Op(node)); |
| return; |
| } |
| @@ -1387,23 +1379,17 @@ class RepresentationSelector { |
| case IrOpcode::kNumberAdd: |
| case IrOpcode::kNumberSubtract: { |
| - if (BothInputsAre(node, Type::Signed32()) && |
| - NodeProperties::GetType(node)->Is(Type::Signed32())) { |
| - // int32 + int32 = int32 |
| - // => signed Int32Add/Sub |
| + if (BothInputsAre(node, type_cache_.kAdditiveSafeIntegerOrMinusZero) && |
| + (GetUpperBound(node)->Is(Type::Signed32()) || |
| + GetUpperBound(node)->Is(Type::Unsigned32()) || |
| + truncation.IsUsedAsWord32())) { |
| + // => Int32Add/Sub |
| VisitInt32Binop(node); |
| - if (lower()) NodeProperties::ChangeOp(node, Int32Op(node)); |
| - } else if (BothInputsAre(node, |
| - type_cache_.kAdditiveSafeIntegerOrMinusZero) && |
| - truncation.IsUsedAsWord32()) { |
| - // safe-int + safe-int = x (truncated to int32) |
| - // => signed Int32Add/Sub (truncated) |
| - VisitWord32TruncatingBinop(node); |
| - if (lower()) NodeProperties::ChangeOp(node, Int32Op(node)); |
| + if (lower()) ChangeToPureOp(node, Int32Op(node)); |
| } else { |
| // => Float64Add/Sub |
| VisitFloat64Binop(node); |
| - if (lower()) NodeProperties::ChangeOp(node, Float64Op(node)); |
| + if (lower()) ChangeToPureOp(node, Float64Op(node)); |
| } |
| return; |
| } |