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

Side by Side Diff: test/cctest/compiler/test-scheduler.cc

Issue 738613005: Restrict floating control to minimal control-connected component. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_scheduler-loop-1
Patch Set: Rebased and adapted. Created 6 years 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/zone-containers.h ('k') | test/unittests/compiler/control-equivalence-unittest.cc » ('j') | 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 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1797 1797
1798 Node* ret = graph.NewNode(common.Return(), phi, ephi1, start); 1798 Node* ret = graph.NewNode(common.Return(), phi, ephi1, start);
1799 Node* end = graph.NewNode(common.End(), ret, start); 1799 Node* end = graph.NewNode(common.End(), ret, start);
1800 1800
1801 graph.SetEnd(end); 1801 graph.SetEnd(end);
1802 1802
1803 ComputeAndVerifySchedule(23, &graph); 1803 ComputeAndVerifySchedule(23, &graph);
1804 } 1804 }
1805 1805
1806 1806
1807 TEST(NestedFloatingDiamondWithChain) {
1808 HandleAndZoneScope scope;
1809 Graph graph(scope.main_zone());
1810 CommonOperatorBuilder common(scope.main_zone());
1811
1812 Node* start = graph.NewNode(common.Start(2));
1813 graph.SetStart(start);
1814
1815 Node* p0 = graph.NewNode(common.Parameter(0), start);
1816 Node* p1 = graph.NewNode(common.Parameter(1), start);
1817 Node* c = graph.NewNode(common.Int32Constant(7));
1818
1819 Node* brA1 = graph.NewNode(common.Branch(), p0, graph.start());
1820 Node* tA1 = graph.NewNode(common.IfTrue(), brA1);
1821 Node* fA1 = graph.NewNode(common.IfFalse(), brA1);
1822 Node* mA1 = graph.NewNode(common.Merge(2), tA1, fA1);
1823 Node* phiA1 = graph.NewNode(common.Phi(kMachAnyTagged, 2), p0, p1, mA1);
1824
1825 Node* brB1 = graph.NewNode(common.Branch(), p1, graph.start());
1826 Node* tB1 = graph.NewNode(common.IfTrue(), brB1);
1827 Node* fB1 = graph.NewNode(common.IfFalse(), brB1);
1828 Node* mB1 = graph.NewNode(common.Merge(2), tB1, fB1);
1829 Node* phiB1 = graph.NewNode(common.Phi(kMachAnyTagged, 2), p0, p1, mB1);
1830
1831 Node* brA2 = graph.NewNode(common.Branch(), phiB1, mA1);
1832 Node* tA2 = graph.NewNode(common.IfTrue(), brA2);
1833 Node* fA2 = graph.NewNode(common.IfFalse(), brA2);
1834 Node* mA2 = graph.NewNode(common.Merge(2), tA2, fA2);
1835 Node* phiA2 = graph.NewNode(common.Phi(kMachAnyTagged, 2), phiB1, c, mA2);
1836
1837 Node* brB2 = graph.NewNode(common.Branch(), phiA1, mB1);
1838 Node* tB2 = graph.NewNode(common.IfTrue(), brB2);
1839 Node* fB2 = graph.NewNode(common.IfFalse(), brB2);
1840 Node* mB2 = graph.NewNode(common.Merge(2), tB2, fB2);
1841 Node* phiB2 = graph.NewNode(common.Phi(kMachAnyTagged, 2), phiA1, c, mB2);
1842
1843 Node* add = graph.NewNode(&kIntAdd, phiA2, phiB2);
1844 Node* ret = graph.NewNode(common.Return(), add, start, start);
1845 Node* end = graph.NewNode(common.End(), ret, start);
1846
1847 graph.SetEnd(end);
1848
1849 ComputeAndVerifySchedule(35, &graph);
1850 }
1851
1852
1807 TEST(NestedFloatingDiamondWithLoop) { 1853 TEST(NestedFloatingDiamondWithLoop) {
1808 HandleAndZoneScope scope; 1854 HandleAndZoneScope scope;
1809 Graph graph(scope.main_zone()); 1855 Graph graph(scope.main_zone());
1810 CommonOperatorBuilder common(scope.main_zone()); 1856 CommonOperatorBuilder common(scope.main_zone());
1811 1857
1812 Node* start = graph.NewNode(common.Start(2)); 1858 Node* start = graph.NewNode(common.Start(2));
1813 graph.SetStart(start); 1859 graph.SetStart(start);
1814 1860
1815 Node* p0 = graph.NewNode(common.Parameter(0), start); 1861 Node* p0 = graph.NewNode(common.Parameter(0), start);
1816 1862
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
2080 graph.SetEnd(end); 2126 graph.SetEnd(end);
2081 2127
2082 Schedule* schedule = ComputeAndVerifySchedule(6, &graph); 2128 Schedule* schedule = ComputeAndVerifySchedule(6, &graph);
2083 BasicBlock* block = schedule->block(loop); 2129 BasicBlock* block = schedule->block(loop);
2084 CHECK_NE(NULL, loop); 2130 CHECK_NE(NULL, loop);
2085 CHECK_EQ(block, schedule->block(effect)); 2131 CHECK_EQ(block, schedule->block(effect));
2086 CHECK_GE(block->rpo_number(), 0); 2132 CHECK_GE(block->rpo_number(), 0);
2087 } 2133 }
2088 2134
2089 #endif 2135 #endif
OLDNEW
« no previous file with comments | « src/zone-containers.h ('k') | test/unittests/compiler/control-equivalence-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698