Index: test/unittests/compiler/scheduler-unittest.cc |
diff --git a/test/unittests/compiler/scheduler-unittest.cc b/test/unittests/compiler/scheduler-unittest.cc |
index e7532faa6d26565e31256403b355498716cd8ddd..1b57e5f4838e22b47191b56b25950ef4ab1e855f 100644 |
--- a/test/unittests/compiler/scheduler-unittest.cc |
+++ b/test/unittests/compiler/scheduler-unittest.cc |
@@ -96,8 +96,7 @@ |
graph()->SetStart(graph()->NewNode(common()->Start(0))); |
Node* p1 = graph()->NewNode(common()->Parameter(0), graph()->start()); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, p1, graph()->start(), |
+ Node* ret = graph()->NewNode(common()->Return(), p1, graph()->start(), |
graph()->start()); |
graph()->SetEnd(graph()->NewNode(common()->End(1), ret)); |
@@ -129,13 +128,12 @@ |
Node* p0 = graph()->NewNode(common()->Parameter(0), start); |
Node* d1 = CreateDiamond(graph(), common(), p0); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, d1, start, start); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- ComputeAndVerifySchedule(14); |
+ Node* ret = graph()->NewNode(common()->Return(), d1, start, start); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ ComputeAndVerifySchedule(13); |
} |
TARGET_TEST_F(SchedulerTest, FloatingDeadDiamond1) { |
@@ -145,13 +143,12 @@ |
Node* p0 = graph()->NewNode(common()->Parameter(0), start); |
Node* d1 = CreateDiamond(graph(), common(), p0); |
USE(d1); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, p0, start, start); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- ComputeAndVerifySchedule(5); |
+ Node* ret = graph()->NewNode(common()->Return(), p0, start, start); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ ComputeAndVerifySchedule(4); |
} |
TARGET_TEST_F(SchedulerTest, FloatingDeadDiamond2) { |
@@ -165,10 +162,9 @@ |
Node* n3 = g->NewNode(common()->IfTrue(), n2); |
Node* n4 = g->NewNode(common()->IfFalse(), n2); |
Node* n5 = g->NewNode(common()->Int32Constant(-100)); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* n6 = g->NewNode(common()->Return(), zero, n5, start, n4); |
+ Node* n6 = g->NewNode(common()->Return(), n5, start, n4); |
Node* n7 = g->NewNode(common()->Int32Constant(0)); |
- Node* n8 = g->NewNode(common()->Return(), zero, n7, start, n3); |
+ Node* n8 = g->NewNode(common()->Return(), n7, start, n3); |
Node* n9 = g->NewNode(common()->End(2), n6, n8); |
// Dead nodes |
@@ -183,7 +179,7 @@ |
g->SetEnd(n9); |
- ComputeAndVerifySchedule(11); |
+ ComputeAndVerifySchedule(10); |
} |
TARGET_TEST_F(SchedulerTest, FloatingDiamond2) { |
@@ -195,13 +191,12 @@ |
Node* d1 = CreateDiamond(graph(), common(), p0); |
Node* d2 = CreateDiamond(graph(), common(), p1); |
Node* add = graph()->NewNode(&kIntAdd, d1, d2); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, add, start, start); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- ComputeAndVerifySchedule(25); |
+ Node* ret = graph()->NewNode(common()->Return(), add, start, start); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ ComputeAndVerifySchedule(24); |
} |
@@ -215,13 +210,12 @@ |
Node* d2 = CreateDiamond(graph(), common(), p1); |
Node* add = graph()->NewNode(&kIntAdd, d1, d2); |
Node* d3 = CreateDiamond(graph(), common(), add); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, d3, start, start); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- ComputeAndVerifySchedule(34); |
+ Node* ret = graph()->NewNode(common()->Return(), d3, start, start); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ ComputeAndVerifySchedule(33); |
} |
@@ -254,13 +248,12 @@ |
fv, phi1, m); |
Node* ephi1 = graph()->NewNode(common()->EffectPhi(2), start, map, m); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, phi, ephi1, start); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- ComputeAndVerifySchedule(24); |
+ Node* ret = graph()->NewNode(common()->Return(), phi, ephi1, start); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ ComputeAndVerifySchedule(23); |
} |
@@ -301,13 +294,12 @@ |
common()->Phi(MachineRepresentation::kTagged, 2), phiA1, c, mB2); |
Node* add = graph()->NewNode(&kIntAdd, phiA2, phiB2); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, add, start, start); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- ComputeAndVerifySchedule(37); |
+ Node* ret = graph()->NewNode(common()->Return(), add, start, start); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ ComputeAndVerifySchedule(36); |
} |
@@ -338,13 +330,12 @@ |
Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), |
fv, ind, m); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, phi, start, start); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- ComputeAndVerifySchedule(21); |
+ Node* ret = graph()->NewNode(common()->Return(), phi, start, start); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ ComputeAndVerifySchedule(20); |
} |
@@ -374,13 +365,12 @@ |
loop->ReplaceInput(1, t); // close loop. |
ind->ReplaceInput(1, phi1); // close induction variable. |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, ind, start, f); |
+ Node* ret = graph()->NewNode(common()->Return(), ind, start, f); |
Node* end = graph()->NewNode(common()->End(2), ret, f); |
graph()->SetEnd(end); |
- ComputeAndVerifySchedule(21); |
+ ComputeAndVerifySchedule(20); |
} |
@@ -411,13 +401,12 @@ |
loop->ReplaceInput(1, t); // close loop. |
ind->ReplaceInput(1, add); // close induction variable. |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, ind, start, f); |
+ Node* ret = graph()->NewNode(common()->Return(), ind, start, f); |
Node* end = graph()->NewNode(common()->End(2), ret, f); |
graph()->SetEnd(end); |
- ComputeAndVerifySchedule(21); |
+ ComputeAndVerifySchedule(20); |
} |
@@ -461,13 +450,12 @@ |
loop->ReplaceInput(1, t); // close loop. |
ind->ReplaceInput(1, add); // close induction variable. |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, ind, start, f); |
+ Node* ret = graph()->NewNode(common()->Return(), ind, start, f); |
Node* end = graph()->NewNode(common()->End(2), ret, f); |
graph()->SetEnd(end); |
- ComputeAndVerifySchedule(29); |
+ ComputeAndVerifySchedule(28); |
} |
@@ -498,13 +486,12 @@ |
Node* phi3 = graph()->NewNode( |
common()->Phi(MachineRepresentation::kTagged, 2), phi, phi2, m2); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, phi3, start, start); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- ComputeAndVerifySchedule(25); |
+ Node* ret = graph()->NewNode(common()->Return(), phi3, start, start); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ ComputeAndVerifySchedule(24); |
} |
@@ -521,13 +508,12 @@ |
Node* m = graph()->NewNode(common()->Merge(2), t, f); |
Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), |
tv, fv, m); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, phi, start, start); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- Schedule* schedule = ComputeAndVerifySchedule(14); |
+ Node* ret = graph()->NewNode(common()->Return(), phi, start, start); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ Schedule* schedule = ComputeAndVerifySchedule(13); |
// Make sure the false block is marked as deferred. |
EXPECT_FALSE(schedule->block(t)->deferred()); |
EXPECT_TRUE(schedule->block(f)->deferred()); |
@@ -547,13 +533,12 @@ |
Node* m = graph()->NewNode(common()->Merge(2), t, f); |
Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), |
tv, fv, m); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, phi, start, start); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- Schedule* schedule = ComputeAndVerifySchedule(14); |
+ Node* ret = graph()->NewNode(common()->Return(), phi, start, start); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ Schedule* schedule = ComputeAndVerifySchedule(13); |
// Make sure the true block is marked as deferred. |
EXPECT_TRUE(schedule->block(t)->deferred()); |
EXPECT_FALSE(schedule->block(f)->deferred()); |
@@ -575,13 +560,12 @@ |
Node* m = graph()->NewNode(common()->Merge(2), ok2, hdl); |
Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), |
c2, p0, m); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, phi, start, m); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- Schedule* schedule = ComputeAndVerifySchedule(18); |
+ Node* ret = graph()->NewNode(common()->Return(), phi, start, m); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ Schedule* schedule = ComputeAndVerifySchedule(17); |
// Make sure the exception blocks as well as the handler are deferred. |
EXPECT_TRUE(schedule->block(ex1)->deferred()); |
EXPECT_TRUE(schedule->block(ex2)->deferred()); |
@@ -619,13 +603,12 @@ |
Node* m = graph()->NewNode(common()->Merge(3), c0, c1, d); |
Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 3), |
v0, v1, vd, m); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, phi, start, m); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- ComputeAndVerifySchedule(17); |
+ Node* ret = graph()->NewNode(common()->Return(), phi, start, m); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ ComputeAndVerifySchedule(16); |
} |
@@ -644,13 +627,12 @@ |
Node* m = graph()->NewNode(common()->Merge(3), c0, c1, d); |
Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 3), |
v0, v1, vd, m); |
- Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
- Node* ret = graph()->NewNode(common()->Return(), zero, phi, start, start); |
- Node* end = graph()->NewNode(common()->End(1), ret); |
- |
- graph()->SetEnd(end); |
- |
- ComputeAndVerifySchedule(17); |
+ Node* ret = graph()->NewNode(common()->Return(), phi, start, start); |
+ Node* end = graph()->NewNode(common()->End(1), ret); |
+ |
+ graph()->SetEnd(end); |
+ |
+ ComputeAndVerifySchedule(16); |
} |