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

Unified Diff: test/cctest/compiler/test-control-reducer.cc

Issue 1000883003: [turbofan] Remove unused diamonds during control reduction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« src/compiler/control-reducer.cc ('K') | « src/compiler/control-reducer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-control-reducer.cc
diff --git a/test/cctest/compiler/test-control-reducer.cc b/test/cctest/compiler/test-control-reducer.cc
index f0efb7ddcd12bfca484cbce344a9d273df62ba43..f6d354767e7f40de5a7b40987fefd18499d5c419 100644
--- a/test/cctest/compiler/test-control-reducer.cc
+++ b/test/cctest/compiler/test-control-reducer.cc
@@ -694,9 +694,9 @@ TEST(CMergeReduce_none1) {
TEST(CMergeReduce_none2) {
ControlReducerTester R;
- Node* t = R.graph.NewNode(R.common.IfTrue(), R.start);
- Node* f = R.graph.NewNode(R.common.IfFalse(), R.start);
- Node* merge = R.graph.NewNode(R.common.Merge(2), t, f);
+ Node* t1 = R.graph.NewNode(R.common.IfTrue(), R.start);
+ Node* t2 = R.graph.NewNode(R.common.IfTrue(), R.start);
+ Node* merge = R.graph.NewNode(R.common.Merge(2), t1, t2);
R.ReduceMerge(merge, merge);
}
@@ -744,7 +744,7 @@ TEST(CMergeReduce_dead_rm1b) {
ControlReducerTester R;
Node* t = R.graph.NewNode(R.common.IfTrue(), R.start);
- Node* f = R.graph.NewNode(R.common.IfFalse(), R.start);
+ Node* f = R.graph.NewNode(R.common.IfTrue(), R.start);
for (int i = 0; i < 2; i++) {
Node* merge = R.graph.NewNode(R.common.Merge(3), R.dead, R.dead, R.dead);
for (int j = i + 1; j < 3; j++) {
@@ -1118,7 +1118,7 @@ TEST(CChainedDiamondsReduce_x_false) {
Diamond d2(R, R.zero);
d2.chain(d1);
- R.ReduceMergeIterative(d1.merge, d2.merge);
+ R.ReduceMergeIterative(R.start, d2.merge);
}
@@ -1128,8 +1128,7 @@ TEST(CChainedDiamondsReduce_false_x) {
Diamond d2(R, R.p0);
d2.chain(d1);
- R.ReduceMergeIterative(d2.merge, d2.merge);
- CheckInputs(d2.branch, R.p0, R.start);
+ R.ReduceMergeIterative(R.start, d2.merge);
}
@@ -1190,6 +1189,14 @@ TEST(CNestedDiamonds_xyz) {
}
+TEST(CDeadDiamond) {
+ ControlReducerTester R;
+ // if (p0) { } else { }
+ Diamond d(R, R.p0);
+ R.ReduceMergeIterative(R.start, d.merge);
+}
+
+
TEST(CDeadLoop1) {
ControlReducerTester R;
@@ -1329,9 +1336,7 @@ TEST(Return_nested_diamonds1) {
CheckInputs(ret, d1.phi, R.start, d1.merge);
CheckInputs(d1.phi, R.one, R.zero, d1.merge);
- CheckInputs(d1.merge, d2.merge, d3.merge);
- CheckLiveDiamond(d2);
- CheckLiveDiamond(d3);
+ CheckInputs(d1.merge, d1.if_true, d1.if_false);
}
@@ -1348,11 +1353,7 @@ TEST(Return_nested_diamonds_true1) {
R.ReduceGraph(); // d1 gets folded true.
- CheckInputs(ret, R.one, R.start, d2.merge);
- CheckInputs(d2.branch, R.p0, R.start);
- CheckDeadDiamond(d1);
- CheckLiveDiamond(d2);
- CheckDeadDiamond(d3);
+ CheckInputs(ret, R.one, R.start, R.start);
}
@@ -1369,11 +1370,7 @@ TEST(Return_nested_diamonds_false1) {
R.ReduceGraph(); // d1 gets folded false.
- CheckInputs(ret, R.zero, R.start, d3.merge);
- CheckInputs(d3.branch, R.p0, R.start);
- CheckDeadDiamond(d1);
- CheckDeadDiamond(d2);
- CheckLiveDiamond(d3);
+ CheckInputs(ret, R.zero, R.start, R.start);
}
« src/compiler/control-reducer.cc ('K') | « src/compiler/control-reducer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698