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

Side by Side Diff: test/cctest/compiler/test-branch-combine.cc

Issue 2008493002: [x64/ia32] Deal with the non-transitivity of InstructionSelector::CanCover() when folding loads int… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 4 years, 6 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/x64/instruction-selector-x64.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 "test/cctest/cctest.h" 5 #include "test/cctest/cctest.h"
6 #include "test/cctest/compiler/codegen-tester.h" 6 #include "test/cctest/compiler/codegen-tester.h"
7 #include "test/cctest/compiler/value-helper.h" 7 #include "test/cctest/compiler/value-helper.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 : eq_constant) 450 : eq_constant)
451 : (cmp.Float64Compare(input_a, input_b) ? eq_constant 451 : (cmp.Float64Compare(input_a, input_b) ? eq_constant
452 : ne_constant); 452 : ne_constant);
453 CHECK_EQ(expected, m.Call()); 453 CHECK_EQ(expected, m.Call());
454 } 454 }
455 } 455 }
456 } 456 }
457 } 457 }
458 } 458 }
459 459
460 TEST(BranchCombineEffectLevel) {
461 // Test that the load doesn't get folded into the branch, as there's a store
462 // between them. See http://crbug.com/611976.
463 int32_t input = 0;
464
465 RawMachineAssemblerTester<int32_t> m;
466 Node* a = m.LoadFromPointer(&input, MachineType::Int32());
467 Node* compare = m.Word32And(a, m.Int32Constant(1));
468 Node* equal = m.Word32Equal(compare, m.Int32Constant(0));
469 m.StoreToPointer(&input, MachineRepresentation::kWord32, m.Int32Constant(1));
470
471 RawMachineLabel blocka, blockb;
472 m.Branch(equal, &blocka, &blockb);
473 m.Bind(&blocka);
474 m.Return(m.Int32Constant(42));
475 m.Bind(&blockb);
476 m.Return(m.Int32Constant(0));
477
478 CHECK_EQ(42, m.Call());
479 }
480
460 } // namespace compiler 481 } // namespace compiler
461 } // namespace internal 482 } // namespace internal
462 } // namespace v8 483 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698