OLD | NEW |
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/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/compiler/all-nodes.h" | 9 #include "src/compiler/all-nodes.h" |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 } | 857 } |
858 } | 858 } |
859 | 859 |
860 | 860 |
861 TEST(CMergeReduce_dead_rm1b) { | 861 TEST(CMergeReduce_dead_rm1b) { |
862 ControlReducerTester R; | 862 ControlReducerTester R; |
863 | 863 |
864 Node* t = R.graph.NewNode(R.common.IfTrue(), R.start); | 864 Node* t = R.graph.NewNode(R.common.IfTrue(), R.start); |
865 Node* f = R.graph.NewNode(R.common.IfTrue(), R.start); | 865 Node* f = R.graph.NewNode(R.common.IfTrue(), R.start); |
866 for (int i = 0; i < 2; i++) { | 866 for (int i = 0; i < 2; i++) { |
867 Node* merge = R.graph.NewNode(R.common.Merge(3), R.dead, R.dead, R.dead); | |
868 for (int j = i + 1; j < 3; j++) { | 867 for (int j = i + 1; j < 3; j++) { |
| 868 Node* merge = R.graph.NewNode(R.common.Merge(3), R.dead, R.dead, R.dead); |
869 merge->ReplaceInput(i, t); | 869 merge->ReplaceInput(i, t); |
870 merge->ReplaceInput(j, f); | 870 merge->ReplaceInput(j, f); |
871 R.ReduceMerge(merge, merge); | 871 R.ReduceMerge(merge, merge); |
872 CheckMerge(merge, t, f); | 872 CheckMerge(merge, t, f); |
873 } | 873 } |
874 } | 874 } |
875 } | 875 } |
876 | 876 |
877 | 877 |
878 TEST(CMergeReduce_dead_rm2) { | 878 TEST(CMergeReduce_dead_rm2) { |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 | 1632 |
1633 R.ReduceGraph(); // d1 gets folded true. | 1633 R.ReduceGraph(); // d1 gets folded true. |
1634 | 1634 |
1635 CheckInputs(ret, y2, R.start, R.start); | 1635 CheckInputs(ret, y2, R.start, R.start); |
1636 | 1636 |
1637 DeadChecker dead(&R.graph); | 1637 DeadChecker dead(&R.graph); |
1638 dead.Check(d1); | 1638 dead.Check(d1); |
1639 dead.Check(d2); | 1639 dead.Check(d2); |
1640 dead.Check(d3); | 1640 dead.Check(d3); |
1641 } | 1641 } |
OLD | NEW |