Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(648)

Side by Side Diff: src/compiler/simplified-lowering.cc

Issue 1584913003: [turbofan] Restore i32+i32->i32 handling in representation inference. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment tweaks Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/simplified-lowering.h" 5 #include "src/compiler/simplified-lowering.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 if (lower()) NodeProperties::ChangeOp(node, Uint32Op(node)); 941 if (lower()) NodeProperties::ChangeOp(node, Uint32Op(node));
942 } else { 942 } else {
943 // => Float64Cmp 943 // => Float64Cmp
944 VisitFloat64Cmp(node); 944 VisitFloat64Cmp(node);
945 if (lower()) NodeProperties::ChangeOp(node, Float64Op(node)); 945 if (lower()) NodeProperties::ChangeOp(node, Float64Op(node));
946 } 946 }
947 break; 947 break;
948 } 948 }
949 case IrOpcode::kNumberAdd: 949 case IrOpcode::kNumberAdd:
950 case IrOpcode::kNumberSubtract: { 950 case IrOpcode::kNumberSubtract: {
951 // Add and subtract reduce to Int32Add/Sub if the inputs 951 if (BothInputsAre(node, Type::Signed32()) &&
952 // are safe integers and all uses are truncating. 952 NodeProperties::GetType(node)->Is(Type::Signed32())) {
953 if (BothInputsAre(node, type_cache_.kAdditiveSafeInteger) && 953 // int32 + int32 = int32
954 truncation.TruncatesToWord32()) {
955 // => signed Int32Add/Sub 954 // => signed Int32Add/Sub
955 VisitInt32Binop(node);
956 if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
957 } else if (BothInputsAre(node, type_cache_.kAdditiveSafeInteger) &&
958 truncation.TruncatesToWord32()) {
959 // safe-int + safe-int = x (truncated to int32)
960 // => signed Int32Add/Sub (truncated)
956 VisitWord32TruncatingBinop(node); 961 VisitWord32TruncatingBinop(node);
957 if (lower()) NodeProperties::ChangeOp(node, Int32Op(node)); 962 if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
958 } else { 963 } else {
959 // => Float64Add/Sub 964 // => Float64Add/Sub
960 VisitFloat64Binop(node); 965 VisitFloat64Binop(node);
961 if (lower()) NodeProperties::ChangeOp(node, Float64Op(node)); 966 if (lower()) NodeProperties::ChangeOp(node, Float64Op(node));
962 } 967 }
963 break; 968 break;
964 } 969 }
965 case IrOpcode::kNumberMultiply: { 970 case IrOpcode::kNumberMultiply: {
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1921 ReplaceEffectUses(node, comparison); 1926 ReplaceEffectUses(node, comparison);
1922 node->ReplaceInput(0, comparison); 1927 node->ReplaceInput(0, comparison);
1923 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); 1928 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL));
1924 node->TrimInputCount(2); 1929 node->TrimInputCount(2);
1925 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual()); 1930 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual());
1926 } 1931 }
1927 1932
1928 } // namespace compiler 1933 } // namespace compiler
1929 } // namespace internal 1934 } // namespace internal
1930 } // namespace v8 1935 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698