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

Side by Side Diff: test/unittests/compiler/common-operator-reducer-unittest.cc

Issue 1218443002: [turbofan] Also update the BranchHint when merging a BooleanNot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address nit. Created 5 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/common-operator-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 "src/compiler/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 #include "src/compiler/common-operator-reducer.h" 6 #include "src/compiler/common-operator-reducer.h"
7 #include "src/compiler/machine-operator.h" 7 #include "src/compiler/machine-operator.h"
8 #include "src/compiler/machine-type.h" 8 #include "src/compiler/machine-type.h"
9 #include "src/compiler/operator.h" 9 #include "src/compiler/operator.h"
10 #include "src/compiler/simplified-operator.h" 10 #include "src/compiler/simplified-operator.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 common()->Branch(hint), 180 common()->Branch(hint),
181 graph()->NewNode(simplified()->BooleanNot(), value), control); 181 graph()->NewNode(simplified()->BooleanNot(), value), control);
182 Node* const if_true = graph()->NewNode(common()->IfTrue(), branch); 182 Node* const if_true = graph()->NewNode(common()->IfTrue(), branch);
183 Node* const if_false = graph()->NewNode(common()->IfFalse(), branch); 183 Node* const if_false = graph()->NewNode(common()->IfFalse(), branch);
184 Reduction const r = Reduce(branch); 184 Reduction const r = Reduce(branch);
185 ASSERT_TRUE(r.Changed()); 185 ASSERT_TRUE(r.Changed());
186 EXPECT_EQ(branch, r.replacement()); 186 EXPECT_EQ(branch, r.replacement());
187 EXPECT_THAT(branch, IsBranch(value, control)); 187 EXPECT_THAT(branch, IsBranch(value, control));
188 EXPECT_THAT(if_false, IsIfTrue(branch)); 188 EXPECT_THAT(if_false, IsIfTrue(branch));
189 EXPECT_THAT(if_true, IsIfFalse(branch)); 189 EXPECT_THAT(if_true, IsIfFalse(branch));
190 EXPECT_EQ(NegateBranchHint(hint), BranchHintOf(branch->op()));
190 } 191 }
191 } 192 }
192 193
193 194
194 // ----------------------------------------------------------------------------- 195 // -----------------------------------------------------------------------------
195 // Merge 196 // Merge
196 197
197 198
198 TEST_F(CommonOperatorReducerTest, MergeOfUnusedDiamond0) { 199 TEST_F(CommonOperatorReducerTest, MergeOfUnusedDiamond0) {
199 Node* const value = Parameter(0); 200 Node* const value = Parameter(0);
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 Node* select = 606 Node* select =
606 graph()->NewNode(common()->Select(kMachFloat64), check, p0, p1); 607 graph()->NewNode(common()->Select(kMachFloat64), check, p0, p1);
607 Reduction r = Reduce(select, MachineOperatorBuilder::kFloat64Min); 608 Reduction r = Reduce(select, MachineOperatorBuilder::kFloat64Min);
608 ASSERT_TRUE(r.Changed()); 609 ASSERT_TRUE(r.Changed());
609 EXPECT_THAT(r.replacement(), IsFloat64Min(p0, p1)); 610 EXPECT_THAT(r.replacement(), IsFloat64Min(p0, p1));
610 } 611 }
611 612
612 } // namespace compiler 613 } // namespace compiler
613 } // namespace internal 614 } // namespace internal
614 } // namespace v8 615 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/common-operator-reducer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698