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

Side by Side Diff: test/unittests/compiler/value-numbering-reducer-unittest.cc

Issue 2145683004: [turbofan] Make sure value numbering only narrows types. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 4 years, 5 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/value-numbering-reducer.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 <limits> 5 #include <limits>
6 6
7 #include "src/compiler/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/node.h" 8 #include "src/compiler/node.h"
9 #include "src/compiler/operator.h" 9 #include "src/compiler/operator.h"
10 #include "src/compiler/value-numbering-reducer.h" 10 #include "src/compiler/value-numbering-reducer.h"
(...skipping 10 matching lines...) Expand all
21 0) {} 21 0) {}
22 }; 22 };
23 23
24 24
25 static const TestOperator kOp0(0, Operator::kIdempotent, 0, 1); 25 static const TestOperator kOp0(0, Operator::kIdempotent, 0, 1);
26 static const TestOperator kOp1(1, Operator::kIdempotent, 1, 1); 26 static const TestOperator kOp1(1, Operator::kIdempotent, 1, 1);
27 27
28 28
29 class ValueNumberingReducerTest : public TestWithZone { 29 class ValueNumberingReducerTest : public TestWithZone {
30 public: 30 public:
31 ValueNumberingReducerTest() : graph_(zone()), reducer_(zone()) {} 31 ValueNumberingReducerTest()
32 : graph_(zone()), reducer_(zone(), graph()->zone()) {}
32 33
33 protected: 34 protected:
34 Reduction Reduce(Node* node) { return reducer_.Reduce(node); } 35 Reduction Reduce(Node* node) { return reducer_.Reduce(node); }
35 36
36 Graph* graph() { return &graph_; } 37 Graph* graph() { return &graph_; }
37 38
38 private: 39 private:
39 Graph graph_; 40 Graph graph_;
40 ValueNumberingReducer reducer_; 41 ValueNumberingReducer reducer_;
41 }; 42 };
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 122
122 TEST_F(ValueNumberingReducerTest, WontReplaceNodeWithItself) { 123 TEST_F(ValueNumberingReducerTest, WontReplaceNodeWithItself) {
123 Node* n = graph()->NewNode(&kOp0); 124 Node* n = graph()->NewNode(&kOp0);
124 EXPECT_FALSE(Reduce(n).Changed()); 125 EXPECT_FALSE(Reduce(n).Changed());
125 EXPECT_FALSE(Reduce(n).Changed()); 126 EXPECT_FALSE(Reduce(n).Changed());
126 } 127 }
127 128
128 } // namespace compiler 129 } // namespace compiler
129 } // namespace internal 130 } // namespace internal
130 } // namespace v8 131 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/value-numbering-reducer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698