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

Side by Side Diff: test/cctest/compiler/test-loop-analysis.cc

Issue 909463002: [turbofan] Fix loop analysis bug with certain phi structures. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/compiler/loop-analysis.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/compiler/access-builder.h" 7 #include "src/compiler/access-builder.h"
8 #include "src/compiler/common-operator.h" 8 #include "src/compiler/common-operator.h"
9 #include "src/compiler/graph.h" 9 #include "src/compiler/graph.h"
10 #include "src/compiler/graph-visualizer.h" 10 #include "src/compiler/graph-visualizer.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 Node* b1[] = {w1.branch, w1.if_true, w2.loop, w2.branch, w2.if_true, 463 Node* b1[] = {w1.branch, w1.if_true, w2.loop, w2.branch, w2.if_true,
464 w2.exit, c2.phi, c1.add, c2.add}; 464 w2.exit, c2.phi, c1.add, c2.add};
465 t.CheckLoop(h1, 2, b1, 9); 465 t.CheckLoop(h1, 2, b1, 9);
466 466
467 Node* h2[] = {w2.loop, c2.phi}; 467 Node* h2[] = {w2.loop, c2.phi};
468 Node* b2[] = {w2.branch, w2.if_true, c2.add}; 468 Node* b2[] = {w2.branch, w2.if_true, c2.add};
469 t.CheckLoop(h2, 2, b2, 3); 469 t.CheckLoop(h2, 2, b2, 3);
470 } 470 }
471 471
472 472
473 TEST(LaNestedLoop1x) {
474 // One loop nested in another.
475 LoopFinderTester t;
476 While w1(t, t.p0);
477 While w2(t, t.p0);
478 w2.nest(w1);
479
480 const Operator* op = t.common.Phi(kMachInt32, 2);
481 Node* p1a = t.graph.NewNode(op, t.p0, t.p0, w1.loop);
482 Node* p1b = t.graph.NewNode(op, t.p0, t.p0, w1.loop);
483 Node* p2a = t.graph.NewNode(op, p1a, t.p0, w2.loop);
484 Node* p2b = t.graph.NewNode(op, p1b, t.p0, w2.loop);
485
486 p1a->ReplaceInput(1, p2b);
487 p1b->ReplaceInput(1, p2a);
488
489 p2a->ReplaceInput(1, p2b);
490 p2b->ReplaceInput(1, p2a);
491
492 t.Return(t.p0, p1a, w1.exit);
493
494 Node* chain[] = {w1.loop, w2.loop};
495 t.CheckNestedLoops(chain, 2);
496
497 Node* h1[] = {w1.loop, p1a, p1b};
498 Node* b1[] = {w1.branch, w1.if_true, w2.loop, p2a,
499 p2b, w2.branch, w2.if_true, w2.exit};
500 t.CheckLoop(h1, 3, b1, 8);
501
502 Node* h2[] = {w2.loop, p2a, p2b};
503 Node* b2[] = {w2.branch, w2.if_true};
504 t.CheckLoop(h2, 3, b2, 2);
505 }
506
507
473 TEST(LaNestedLoop2) { 508 TEST(LaNestedLoop2) {
474 // Two loops nested in an outer loop. 509 // Two loops nested in an outer loop.
475 LoopFinderTester t; 510 LoopFinderTester t;
476 While w1(t, t.p0); 511 While w1(t, t.p0);
477 While w2(t, t.p0); 512 While w2(t, t.p0);
478 While w3(t, t.p0); 513 While w3(t, t.p0);
479 w2.nest(w1); 514 w2.nest(w1);
480 w3.nest(w1); 515 w3.nest(w1);
481 w3.chain(w2.exit); 516 w3.chain(w2.exit);
482 t.Return(t.p0, t.start, w1.exit); 517 t.Return(t.p0, t.start, w1.exit);
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 TEST(LaManyChained_64) { RunManyChainedLoops_i(64); } 1003 TEST(LaManyChained_64) { RunManyChainedLoops_i(64); }
969 1004
970 TEST(LaManyNested_30) { RunManyNestedLoops_i(30); } 1005 TEST(LaManyNested_30) { RunManyNestedLoops_i(30); }
971 TEST(LaManyNested_31) { RunManyNestedLoops_i(31); } 1006 TEST(LaManyNested_31) { RunManyNestedLoops_i(31); }
972 TEST(LaManyNested_32) { RunManyNestedLoops_i(32); } 1007 TEST(LaManyNested_32) { RunManyNestedLoops_i(32); }
973 TEST(LaManyNested_33) { RunManyNestedLoops_i(33); } 1008 TEST(LaManyNested_33) { RunManyNestedLoops_i(33); }
974 TEST(LaManyNested_34) { RunManyNestedLoops_i(34); } 1009 TEST(LaManyNested_34) { RunManyNestedLoops_i(34); }
975 TEST(LaManyNested_62) { RunManyNestedLoops_i(62); } 1010 TEST(LaManyNested_62) { RunManyNestedLoops_i(62); }
976 TEST(LaManyNested_63) { RunManyNestedLoops_i(63); } 1011 TEST(LaManyNested_63) { RunManyNestedLoops_i(63); }
977 TEST(LaManyNested_64) { RunManyNestedLoops_i(64); } 1012 TEST(LaManyNested_64) { RunManyNestedLoops_i(64); }
1013
1014
1015 TEST(LaPhiTangle) { LoopFinderTester t; }
OLDNEW
« no previous file with comments | « src/compiler/loop-analysis.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698