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

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: Resurrect tests 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..1a0551442c1e4d98ae38e5f39cfad23701e471c2 100644
--- a/test/cctest/compiler/test-js-typed-lowering.cc
+++ b/test/cctest/compiler/test-js-typed-lowering.cc
@@ -1231,11 +1231,7 @@ TEST(Int32AddNarrowing) {
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)));
+ CHECK_EQ(IrOpcode::kNumberAdd, add_node->opcode());
}
}
}
@@ -1258,40 +1254,33 @@ TEST(Int32AddNarrowing) {
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)));
+ CHECK_EQ(IrOpcode::kNumberAdd, add_node->opcode());
}
}
}
}
}
-}
-
-
-TEST(Int32AddNarrowingNotOwned) {
- JSBitwiseTypedLoweringTester R;
+ {
+ JSBitwiseTypedLoweringTester R;
- for (int o = 0; o < R.kNumberOps; o += 2) {
- Node* n0 = R.Parameter(I32Type(R.signedness[o]));
- Node* n1 = R.Parameter(I32Type(R.signedness[o + 1]));
- Node* one = R.graph.NewNode(R.common.NumberConstant(1));
-
- Node* add_node = R.Binop(R.simplified.NumberAdd(), n0, n1);
- Node* or_node = R.Binop(R.ops[o], add_node, one);
- 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]);
- CheckToI32(one, r->InputAt(1), R.signedness[o + 1]);
- // The other use should also not be touched.
- CHECK_EQ(add_node, other_use->InputAt(0));
- CHECK_EQ(one, other_use->InputAt(1));
+ for (int o = 0; o < R.kNumberOps; o += 2) {
+ Node* n0 = R.Parameter(I32Type(R.signedness[o]));
+ Node* n1 = R.Parameter(I32Type(R.signedness[o + 1]));
+ Node* one = R.graph.NewNode(R.common.NumberConstant(1));
+
+ Node* add_node = R.Binop(R.simplified.NumberAdd(), n0, n1);
+ Node* or_node = R.Binop(R.ops[o], add_node, one);
+ 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());
+ CHECK_EQ(IrOpcode::kNumberAdd, add_node->opcode());
+ // Conversion to int32 should be done.
+ CheckToI32(add_node, r->InputAt(0), R.signedness[o]);
+ CheckToI32(one, r->InputAt(1), R.signedness[o + 1]);
+ // The other use should also not be touched.
+ CHECK_EQ(add_node, other_use->InputAt(0));
+ CHECK_EQ(one, other_use->InputAt(1));
+ }
}
}
« 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