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

Side by Side Diff: test/unittests/compiler/scheduler-unittest.cc

Issue 1123213002: [turbofan] Connect non-terminating loops via Terminate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/common-operator.h" 6 #include "src/compiler/common-operator.h"
7 #include "src/compiler/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/graph-visualizer.h" 8 #include "src/compiler/graph-visualizer.h"
9 #include "src/compiler/js-operator.h" 9 #include "src/compiler/js-operator.h"
10 #include "src/compiler/node.h" 10 #include "src/compiler/node.h"
(...skipping 2449 matching lines...) Expand 10 before | Expand all | Expand 10 after
2460 Node* m = graph()->NewNode(common()->Merge(3), c0, c1, d); 2460 Node* m = graph()->NewNode(common()->Merge(3), c0, c1, d);
2461 Node* phi = graph()->NewNode(common()->Phi(kMachInt32, 3), v0, v1, vd, m); 2461 Node* phi = graph()->NewNode(common()->Phi(kMachInt32, 3), v0, v1, vd, m);
2462 Node* ret = graph()->NewNode(common()->Return(), phi, start, start); 2462 Node* ret = graph()->NewNode(common()->Return(), phi, start, start);
2463 Node* end = graph()->NewNode(common()->End(), ret); 2463 Node* end = graph()->NewNode(common()->End(), ret);
2464 2464
2465 graph()->SetEnd(end); 2465 graph()->SetEnd(end);
2466 2466
2467 ComputeAndVerifySchedule(16); 2467 ComputeAndVerifySchedule(16);
2468 } 2468 }
2469 2469
2470
2471 TARGET_TEST_F(SchedulerTest, Terminate) {
2472 Node* start = graph()->NewNode(common()->Start(1));
2473 graph()->SetStart(start);
2474
2475 Node* loop = graph()->NewNode(common()->Loop(2), start, start);
2476 loop->ReplaceInput(1, loop); // self loop, NTL.
2477
2478 Node* effect = graph()->NewNode(common()->EffectPhi(1), start, loop);
2479
2480 Node* terminate = graph()->NewNode(common()->Terminate(), effect, loop);
2481 effect->ReplaceInput(1, terminate);
2482
2483 Node* end = graph()->NewNode(common()->End(), terminate);
2484
2485 graph()->SetEnd(end);
2486
2487 Schedule* schedule = ComputeAndVerifySchedule(6);
2488 BasicBlock* block = schedule->block(loop);
2489 EXPECT_EQ(block, schedule->block(effect));
2490 EXPECT_GE(block->rpo_number(), 0);
2491 }
2492
2470 } // namespace compiler 2493 } // namespace compiler
2471 } // namespace internal 2494 } // namespace internal
2472 } // namespace v8 2495 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698