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

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

Issue 2135123002: [turbofan] Eliminate a few redundant bounds checks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix BranchElimination to play well with the other reducers. Created 4 years, 5 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 | « src/compiler/pipeline.cc ('k') | 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/address-map.h" 9 #include "src/address-map.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 // No input representation requirement; adapt during lowering. 1263 // No input representation requirement; adapt during lowering.
1264 ProcessInput(node, 0, UseInfo::AnyTruncatingToBool()); 1264 ProcessInput(node, 0, UseInfo::AnyTruncatingToBool());
1265 SetOutput(node, MachineRepresentation::kWord32); 1265 SetOutput(node, MachineRepresentation::kWord32);
1266 } 1266 }
1267 return; 1267 return;
1268 } 1268 }
1269 case IrOpcode::kNumberEqual: 1269 case IrOpcode::kNumberEqual:
1270 case IrOpcode::kNumberLessThan: 1270 case IrOpcode::kNumberLessThan:
1271 case IrOpcode::kNumberLessThanOrEqual: { 1271 case IrOpcode::kNumberLessThanOrEqual: {
1272 // Number comparisons reduce to integer comparisons for integer inputs. 1272 // Number comparisons reduce to integer comparisons for integer inputs.
1273 if (TypeOf(node->InputAt(0))->Is(Type::Signed32()) && 1273 if (TypeOf(node->InputAt(0))->Is(Type::Unsigned32()) &&
1274 TypeOf(node->InputAt(1))->Is(Type::Signed32())) { 1274 TypeOf(node->InputAt(1))->Is(Type::Unsigned32())) {
1275 // => unsigned Int32Cmp
1276 VisitUint32Cmp(node);
1277 if (lower()) NodeProperties::ChangeOp(node, Uint32Op(node));
1278 } else if (TypeOf(node->InputAt(0))->Is(Type::Signed32()) &&
1279 TypeOf(node->InputAt(1))->Is(Type::Signed32())) {
1275 // => signed Int32Cmp 1280 // => signed Int32Cmp
1276 VisitInt32Cmp(node); 1281 VisitInt32Cmp(node);
1277 if (lower()) NodeProperties::ChangeOp(node, Int32Op(node)); 1282 if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
1278 } else if (TypeOf(node->InputAt(0))->Is(Type::Unsigned32()) &&
1279 TypeOf(node->InputAt(1))->Is(Type::Unsigned32())) {
1280 // => unsigned Int32Cmp
1281 VisitUint32Cmp(node);
1282 if (lower()) NodeProperties::ChangeOp(node, Uint32Op(node));
1283 } else { 1283 } else {
1284 // => Float64Cmp 1284 // => Float64Cmp
1285 VisitFloat64Cmp(node); 1285 VisitFloat64Cmp(node);
1286 if (lower()) NodeProperties::ChangeOp(node, Float64Op(node)); 1286 if (lower()) NodeProperties::ChangeOp(node, Float64Op(node));
1287 } 1287 }
1288 return; 1288 return;
1289 } 1289 }
1290 1290
1291 case IrOpcode::kSpeculativeNumberAdd: 1291 case IrOpcode::kSpeculativeNumberAdd:
1292 case IrOpcode::kSpeculativeNumberSubtract: 1292 case IrOpcode::kSpeculativeNumberSubtract:
1293 return VisitSpeculativeAdditiveOp(node, truncation, lowering); 1293 return VisitSpeculativeAdditiveOp(node, truncation, lowering);
1294 1294
1295 case IrOpcode::kSpeculativeNumberLessThan: 1295 case IrOpcode::kSpeculativeNumberLessThan:
1296 case IrOpcode::kSpeculativeNumberLessThanOrEqual: 1296 case IrOpcode::kSpeculativeNumberLessThanOrEqual:
1297 case IrOpcode::kSpeculativeNumberEqual: { 1297 case IrOpcode::kSpeculativeNumberEqual: {
1298 // Number comparisons reduce to integer comparisons for integer inputs. 1298 // Number comparisons reduce to integer comparisons for integer inputs.
1299 if (TypeOf(node->InputAt(0))->Is(Type::Signed32()) && 1299 if (TypeOf(node->InputAt(0))->Is(Type::Unsigned32()) &&
1300 TypeOf(node->InputAt(1))->Is(Type::Signed32())) { 1300 TypeOf(node->InputAt(1))->Is(Type::Unsigned32())) {
1301 // => unsigned Int32Cmp
1302 VisitUint32Cmp(node);
1303 if (lower()) ChangeToPureOp(node, Uint32Op(node));
1304 return;
1305 } else if (TypeOf(node->InputAt(0))->Is(Type::Signed32()) &&
1306 TypeOf(node->InputAt(1))->Is(Type::Signed32())) {
1301 // => signed Int32Cmp 1307 // => signed Int32Cmp
1302 VisitInt32Cmp(node); 1308 VisitInt32Cmp(node);
1303 if (lower()) ChangeToPureOp(node, Int32Op(node)); 1309 if (lower()) ChangeToPureOp(node, Int32Op(node));
1304 return; 1310 return;
1305 } else if (TypeOf(node->InputAt(0))->Is(Type::Unsigned32()) &&
1306 TypeOf(node->InputAt(1))->Is(Type::Unsigned32())) {
1307 // => unsigned Int32Cmp
1308 VisitUint32Cmp(node);
1309 if (lower()) ChangeToPureOp(node, Uint32Op(node));
1310 return;
1311 } 1311 }
1312 // Try to use type feedback. 1312 // Try to use type feedback.
1313 CompareOperationHints::Hint hint = CompareOperationHintOf(node->op()); 1313 CompareOperationHints::Hint hint = CompareOperationHintOf(node->op());
1314 1314
1315 if (hint == CompareOperationHints::kSignedSmall) { 1315 if (hint == CompareOperationHints::kSignedSmall) {
1316 VisitBinop(node, UseInfo::CheckedSigned32AsWord32(), 1316 VisitBinop(node, UseInfo::CheckedSigned32AsWord32(),
1317 MachineRepresentation::kBit); 1317 MachineRepresentation::kBit);
1318 if (lower()) ChangeToPureOp(node, Int32Op(node)); 1318 if (lower()) ChangeToPureOp(node, Int32Op(node));
1319 return; 1319 return;
1320 } 1320 }
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after
3263 isolate(), graph()->zone(), callable.descriptor(), 0, flags, 3263 isolate(), graph()->zone(), callable.descriptor(), 0, flags,
3264 Operator::kNoProperties); 3264 Operator::kNoProperties);
3265 to_number_operator_.set(common()->Call(desc)); 3265 to_number_operator_.set(common()->Call(desc));
3266 } 3266 }
3267 return to_number_operator_.get(); 3267 return to_number_operator_.get();
3268 } 3268 }
3269 3269
3270 } // namespace compiler 3270 } // namespace compiler
3271 } // namespace internal 3271 } // namespace internal
3272 } // namespace v8 3272 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/pipeline.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698