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

Unified Diff: test/unittests/compiler/scheduler-unittest.cc

Issue 931623002: [turbofan] Optimize certain chains of Branch into a Switch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addrssed comments. Created 5 years, 10 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
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | test/unittests/unittests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/scheduler-unittest.cc
diff --git a/test/unittests/compiler/scheduler-unittest.cc b/test/unittests/compiler/scheduler-unittest.cc
index 66496e2baf0d27b697a0970d3e459eedf966713c..860d5cd32552f425766de6504f6006a05c1b21f4 100644
--- a/test/unittests/compiler/scheduler-unittest.cc
+++ b/test/unittests/compiler/scheduler-unittest.cc
@@ -1973,19 +1973,21 @@ TARGET_TEST_F(SchedulerTest, Switch) {
graph()->SetStart(start);
Node* p0 = graph()->NewNode(common()->Parameter(0), start);
- Node* sw = graph()->NewNode(common()->Switch(2), p0, start);
- Node* c0 = graph()->NewNode(common()->Case(0), sw);
+ Node* sw = graph()->NewNode(common()->Switch(3), p0, start);
+ Node* c0 = graph()->NewNode(common()->IfValue(0), sw);
Node* v0 = graph()->NewNode(common()->Int32Constant(11));
- Node* c1 = graph()->NewNode(common()->Case(1), sw);
+ Node* c1 = graph()->NewNode(common()->IfValue(1), sw);
Node* v1 = graph()->NewNode(common()->Int32Constant(22));
- Node* m = graph()->NewNode(common()->Merge(2), c0, c1);
- Node* phi = graph()->NewNode(common()->Phi(kMachInt32, 2), v0, v1, m);
+ Node* d = graph()->NewNode(common()->IfDefault(), sw);
+ Node* vd = graph()->NewNode(common()->Int32Constant(33));
+ Node* m = graph()->NewNode(common()->Merge(3), c0, c1, d);
+ Node* phi = graph()->NewNode(common()->Phi(kMachInt32, 3), v0, v1, vd, m);
Node* ret = graph()->NewNode(common()->Return(), phi, start, m);
Node* end = graph()->NewNode(common()->End(), ret);
graph()->SetEnd(end);
- ComputeAndVerifySchedule(13, graph());
+ ComputeAndVerifySchedule(16, graph());
}
@@ -1994,19 +1996,21 @@ TARGET_TEST_F(SchedulerTest, FloatingSwitch) {
graph()->SetStart(start);
Node* p0 = graph()->NewNode(common()->Parameter(0), start);
- Node* sw = graph()->NewNode(common()->Switch(2), p0, start);
- Node* c0 = graph()->NewNode(common()->Case(0), sw);
+ Node* sw = graph()->NewNode(common()->Switch(3), p0, start);
+ Node* c0 = graph()->NewNode(common()->IfValue(0), sw);
Node* v0 = graph()->NewNode(common()->Int32Constant(11));
- Node* c1 = graph()->NewNode(common()->Case(1), sw);
+ Node* c1 = graph()->NewNode(common()->IfValue(1), sw);
Node* v1 = graph()->NewNode(common()->Int32Constant(22));
- Node* m = graph()->NewNode(common()->Merge(2), c0, c1);
- Node* phi = graph()->NewNode(common()->Phi(kMachInt32, 2), v0, v1, m);
+ Node* d = graph()->NewNode(common()->IfDefault(), sw);
+ Node* vd = graph()->NewNode(common()->Int32Constant(33));
+ Node* m = graph()->NewNode(common()->Merge(3), c0, c1, d);
+ Node* phi = graph()->NewNode(common()->Phi(kMachInt32, 3), v0, v1, vd, m);
Node* ret = graph()->NewNode(common()->Return(), phi, start, start);
Node* end = graph()->NewNode(common()->End(), ret);
graph()->SetEnd(end);
- ComputeAndVerifySchedule(13, graph());
+ ComputeAndVerifySchedule(16, graph());
}
} // namespace compiler
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | test/unittests/unittests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698