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

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

Issue 702683002: Avoid redundant work in scheduler loop header/depth calculation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove scary printing again. Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/scheduler.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 #include "test/cctest/cctest.h" 6 #include "test/cctest/cctest.h"
7 7
8 #include "src/compiler/access-builder.h" 8 #include "src/compiler/access-builder.h"
9 #include "src/compiler/common-operator.h" 9 #include "src/compiler/common-operator.h"
10 #include "src/compiler/generic-node-inl.h" 10 #include "src/compiler/generic-node-inl.h"
(...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 1809
1810 Node* ret = graph.NewNode(common.Return(), phi, ephi1, start); 1810 Node* ret = graph.NewNode(common.Return(), phi, ephi1, start);
1811 Node* end = graph.NewNode(common.End(), ret, start); 1811 Node* end = graph.NewNode(common.End(), ret, start);
1812 1812
1813 graph.SetEnd(end); 1813 graph.SetEnd(end);
1814 1814
1815 ComputeAndVerifySchedule(23, &graph); 1815 ComputeAndVerifySchedule(23, &graph);
1816 } 1816 }
1817 1817
1818 1818
1819 TEST(LoopedFloatingDiamond) { 1819 TEST(LoopedFloatingDiamond1) {
1820 HandleAndZoneScope scope; 1820 HandleAndZoneScope scope;
1821 Graph graph(scope.main_zone()); 1821 Graph graph(scope.main_zone());
1822 CommonOperatorBuilder common(scope.main_zone()); 1822 CommonOperatorBuilder common(scope.main_zone());
1823 SimplifiedOperatorBuilder simplified(scope.main_zone()); 1823 SimplifiedOperatorBuilder simplified(scope.main_zone());
1824 MachineOperatorBuilder machine; 1824 MachineOperatorBuilder machine;
1825 1825
1826 Node* start = graph.NewNode(common.Start(2)); 1826 Node* start = graph.NewNode(common.Start(2));
1827 graph.SetStart(start); 1827 graph.SetStart(start);
1828 1828
1829 Node* p0 = graph.NewNode(common.Parameter(0), start); 1829 Node* p0 = graph.NewNode(common.Parameter(0), start);
(...skipping 18 matching lines...) Expand all
1848 1848
1849 Node* ret = graph.NewNode(common.Return(), ind, start, f); 1849 Node* ret = graph.NewNode(common.Return(), ind, start, f);
1850 Node* end = graph.NewNode(common.End(), ret, f); 1850 Node* end = graph.NewNode(common.End(), ret, f);
1851 1851
1852 graph.SetEnd(end); 1852 graph.SetEnd(end);
1853 1853
1854 ComputeAndVerifySchedule(20, &graph); 1854 ComputeAndVerifySchedule(20, &graph);
1855 } 1855 }
1856 1856
1857 1857
1858 TEST(LoopedFloatingDiamond2) {
1859 HandleAndZoneScope scope;
1860 Graph graph(scope.main_zone());
1861 CommonOperatorBuilder common(scope.main_zone());
1862 SimplifiedOperatorBuilder simplified(scope.main_zone());
1863 MachineOperatorBuilder machine;
1864
1865 Node* start = graph.NewNode(common.Start(2));
1866 graph.SetStart(start);
1867
1868 Node* p0 = graph.NewNode(common.Parameter(0), start);
1869
1870 Node* c = graph.NewNode(common.Int32Constant(7));
1871 Node* loop = graph.NewNode(common.Loop(2), start, start);
1872 Node* ind = graph.NewNode(common.Phi(kMachAnyTagged, 2), p0, p0, loop);
1873
1874 Node* br1 = graph.NewNode(common.Branch(), p0, graph.start());
1875 Node* t1 = graph.NewNode(common.IfTrue(), br1);
1876 Node* f1 = graph.NewNode(common.IfFalse(), br1);
1877 Node* m1 = graph.NewNode(common.Merge(2), t1, f1);
1878 Node* phi1 = graph.NewNode(common.Phi(kMachAnyTagged, 2), c, ind, m1);
1879
1880 Node* add = graph.NewNode(machine.IntAdd(), ind, phi1);
1881
1882 Node* br = graph.NewNode(common.Branch(), add, loop);
1883 Node* t = graph.NewNode(common.IfTrue(), br);
1884 Node* f = graph.NewNode(common.IfFalse(), br);
1885
1886 loop->ReplaceInput(1, t); // close loop.
1887 ind->ReplaceInput(1, add); // close induction variable.
1888
1889 Node* ret = graph.NewNode(common.Return(), ind, start, f);
1890 Node* end = graph.NewNode(common.End(), ret, f);
1891
1892 graph.SetEnd(end);
1893
1894 ComputeAndVerifySchedule(20, &graph);
1895 }
1896
1897
1858 TEST(PhisPushedDownToDifferentBranches) { 1898 TEST(PhisPushedDownToDifferentBranches) {
1859 HandleAndZoneScope scope; 1899 HandleAndZoneScope scope;
1860 Graph graph(scope.main_zone()); 1900 Graph graph(scope.main_zone());
1861 CommonOperatorBuilder common(scope.main_zone()); 1901 CommonOperatorBuilder common(scope.main_zone());
1862 SimplifiedOperatorBuilder simplified(scope.main_zone()); 1902 SimplifiedOperatorBuilder simplified(scope.main_zone());
1863 MachineOperatorBuilder machine; 1903 MachineOperatorBuilder machine;
1864 1904
1865 Node* start = graph.NewNode(common.Start(2)); 1905 Node* start = graph.NewNode(common.Start(2));
1866 graph.SetStart(start); 1906 graph.SetStart(start);
1867 1907
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1970 graph.SetEnd(end); 2010 graph.SetEnd(end);
1971 2011
1972 Schedule* schedule = ComputeAndVerifySchedule(6, &graph); 2012 Schedule* schedule = ComputeAndVerifySchedule(6, &graph);
1973 BasicBlock* block = schedule->block(loop); 2013 BasicBlock* block = schedule->block(loop);
1974 CHECK_NE(NULL, loop); 2014 CHECK_NE(NULL, loop);
1975 CHECK_EQ(block, schedule->block(effect)); 2015 CHECK_EQ(block, schedule->block(effect));
1976 CHECK_GE(block->rpo_number(), 0); 2016 CHECK_GE(block->rpo_number(), 0);
1977 } 2017 }
1978 2018
1979 #endif 2019 #endif
OLDNEW
« no previous file with comments | « src/compiler/scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698