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

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

Issue 539833003: [turbofan] Value numbering should never replace a node with itself. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« 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/value-numbering-reducer.h" 8 #include "src/compiler/value-numbering-reducer.h"
9 #include "src/test/test-utils.h" 9 #include "src/test/test-utils.h"
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 r = Reduce(graph()->NewNode(&op1, static_cast<int>(input_count), inputs)); 99 r = Reduce(graph()->NewNode(&op1, static_cast<int>(input_count), inputs));
100 ASSERT_TRUE(r.Changed()); 100 ASSERT_TRUE(r.Changed());
101 EXPECT_EQ(n, r.replacement()); 101 EXPECT_EQ(n, r.replacement());
102 102
103 r = Reduce(graph()->NewNode(&op1, static_cast<int>(input_count), inputs)); 103 r = Reduce(graph()->NewNode(&op1, static_cast<int>(input_count), inputs));
104 ASSERT_TRUE(r.Changed()); 104 ASSERT_TRUE(r.Changed());
105 EXPECT_EQ(n, r.replacement()); 105 EXPECT_EQ(n, r.replacement());
106 } 106 }
107 } 107 }
108 108
109
110 TEST_F(ValueNumberingReducerTest, WontReplaceNodeWithItself) {
111 Node* n = graph()->NewNode(&kOp0);
112 EXPECT_FALSE(Reduce(n).Changed());
113 EXPECT_FALSE(Reduce(n).Changed());
114 }
115
109 } // namespace compiler 116 } // namespace compiler
110 } // namespace internal 117 } // namespace internal
111 } // namespace v8 118 } // 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