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

Unified Diff: test/cctest/compiler/test-js-typed-lowering.cc

Issue 721723004: [turbofan] Remove int32 add/subtract narrowing during typed lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | test/mjsunit/regress/regress-unsigned-mul-add.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-js-typed-lowering.cc
diff --git a/test/cctest/compiler/test-js-typed-lowering.cc b/test/cctest/compiler/test-js-typed-lowering.cc
index ee69e1743b946e6dbf501eb5f6bb2f8695810d51..417c7c338ecce40cdc59fed8b8ca115f8e956866 100644
--- a/test/cctest/compiler/test-js-typed-lowering.cc
+++ b/test/cctest/compiler/test-js-typed-lowering.cc
@@ -1213,65 +1213,7 @@ TEST(UnaryNotEffects) {
}
-TEST(Int32AddNarrowing) {
- {
- JSBitwiseTypedLoweringTester R;
-
- for (int o = 0; o < R.kNumberOps; o += 2) {
- for (size_t i = 0; i < arraysize(kInt32Types); i++) {
- Node* n0 = R.Parameter(kInt32Types[i]);
- for (size_t j = 0; j < arraysize(kInt32Types); j++) {
- Node* n1 = R.Parameter(kInt32Types[j]);
- Node* one = R.graph.NewNode(R.common.NumberConstant(1));
-
- for (int l = 0; l < 2; l++) {
- Node* add_node = R.Binop(R.simplified.NumberAdd(), n0, n1);
- Node* or_node =
- R.Binop(R.ops[o], l ? add_node : one, l ? one : add_node);
- Node* r = R.reduce(or_node);
-
- CHECK_EQ(R.ops[o + 1]->opcode(), r->op()->opcode());
- CHECK_EQ(IrOpcode::kInt32Add, add_node->opcode());
- bool is_signed = l ? R.signedness[o] : R.signedness[o + 1];
-
- Type* add_type = NodeProperties::GetBounds(add_node).upper;
- CHECK(add_type->Is(I32Type(is_signed)));
- }
- }
- }
- }
- }
- {
- JSBitwiseShiftTypedLoweringTester R;
-
- for (int o = 0; o < R.kNumberOps; o += 2) {
- for (size_t i = 0; i < arraysize(kInt32Types); i++) {
- Node* n0 = R.Parameter(kInt32Types[i]);
- for (size_t j = 0; j < arraysize(kInt32Types); j++) {
- Node* n1 = R.Parameter(kInt32Types[j]);
- Node* one = R.graph.NewNode(R.common.NumberConstant(1));
-
- for (int l = 0; l < 2; l++) {
- Node* add_node = R.Binop(R.simplified.NumberAdd(), n0, n1);
- Node* or_node =
- R.Binop(R.ops[o], l ? add_node : one, l ? one : add_node);
- Node* r = R.reduce(or_node);
-
- CHECK_EQ(R.ops[o + 1]->opcode(), r->op()->opcode());
- CHECK_EQ(IrOpcode::kInt32Add, add_node->opcode());
- bool is_signed = l ? R.signedness[o] : R.signedness[o + 1];
-
- Type* add_type = NodeProperties::GetBounds(add_node).upper;
- CHECK(add_type->Is(I32Type(is_signed)));
- }
- }
- }
- }
- }
-}
-
-
-TEST(Int32AddNarrowingNotOwned) {
+TEST(Int32AddLowering) {
titzer 2014/11/14 14:26:20 I think we should keep these tests but assert now
JSBitwiseTypedLoweringTester R;
for (int o = 0; o < R.kNumberOps; o += 2) {
@@ -1284,7 +1226,6 @@ TEST(Int32AddNarrowingNotOwned) {
Node* other_use = R.Binop(R.simplified.NumberAdd(), add_node, one);
Node* r = R.reduce(or_node);
CHECK_EQ(R.ops[o + 1]->opcode(), r->op()->opcode());
- // Should not be reduced to Int32Add because of the other number add.
CHECK_EQ(IrOpcode::kNumberAdd, add_node->opcode());
// Conversion to int32 should be done.
CheckToI32(add_node, r->InputAt(0), R.signedness[o]);
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | test/mjsunit/regress/regress-unsigned-mul-add.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698