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

Side by Side Diff: test/cctest/compiler/test-machine-operator-reducer.cc

Issue 1347353003: [turbofan] Checking of input counts on node creation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: NewNode -> AddNode Created 5 years, 2 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 | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | test/cctest/compiler/test-node.cc » ('j') | 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 6
7 #include "src/base/utils/random-number-generator.h" 7 #include "src/base/utils/random-number-generator.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/machine-operator-reducer.h" 10 #include "src/compiler/machine-operator-reducer.h"
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 R.CheckFoldBinop<int32_t>(1, zero, x); // 0 <= x => 1 696 R.CheckFoldBinop<int32_t>(1, zero, x); // 0 <= x => 1
697 R.CheckFoldBinop<int32_t>(1, x, x); // x <= x => 1 697 R.CheckFoldBinop<int32_t>(1, x, x); // x <= x => 1
698 } 698 }
699 699
700 700
701 TEST(ReduceLoadStore) { 701 TEST(ReduceLoadStore) {
702 ReducerTester R; 702 ReducerTester R;
703 703
704 Node* base = R.Constant<int32_t>(11); 704 Node* base = R.Constant<int32_t>(11);
705 Node* index = R.Constant<int32_t>(4); 705 Node* index = R.Constant<int32_t>(4);
706 Node* load = R.graph.NewNode(R.machine.Load(kMachInt32), base, index); 706 Node* load = R.graph.NewNode(R.machine.Load(kMachInt32), base, index,
707 R.graph.start(), R.graph.start());
707 708
708 { 709 {
709 MachineOperatorReducer reducer(&R.jsgraph); 710 MachineOperatorReducer reducer(&R.jsgraph);
710 Reduction reduction = reducer.Reduce(load); 711 Reduction reduction = reducer.Reduce(load);
711 CHECK(!reduction.Changed()); // loads should not be reduced. 712 CHECK(!reduction.Changed()); // loads should not be reduced.
712 } 713 }
713 714
714 { 715 {
715 Node* store = R.graph.NewNode( 716 Node* store = R.graph.NewNode(
716 R.machine.Store(StoreRepresentation(kMachInt32, kNoWriteBarrier)), base, 717 R.machine.Store(StoreRepresentation(kMachInt32, kNoWriteBarrier)), base,
717 index, load); 718 index, load, load, load);
718 MachineOperatorReducer reducer(&R.jsgraph); 719 MachineOperatorReducer reducer(&R.jsgraph);
719 Reduction reduction = reducer.Reduce(store); 720 Reduction reduction = reducer.Reduce(store);
720 CHECK(!reduction.Changed()); // stores should not be reduced. 721 CHECK(!reduction.Changed()); // stores should not be reduced.
721 } 722 }
722 } 723 }
723 724
724 725
725 // TODO(titzer): test MachineOperatorReducer for Word64And 726 // TODO(titzer): test MachineOperatorReducer for Word64And
726 // TODO(titzer): test MachineOperatorReducer for Word64Or 727 // TODO(titzer): test MachineOperatorReducer for Word64Or
727 // TODO(titzer): test MachineOperatorReducer for Word64Xor 728 // TODO(titzer): test MachineOperatorReducer for Word64Xor
(...skipping 12 matching lines...) Expand all
740 // TODO(titzer): test MachineOperatorReducer for Uint64Mod 741 // TODO(titzer): test MachineOperatorReducer for Uint64Mod
741 // TODO(titzer): test MachineOperatorReducer for Int64Neg 742 // TODO(titzer): test MachineOperatorReducer for Int64Neg
742 // TODO(titzer): test MachineOperatorReducer for ChangeInt32ToFloat64 743 // TODO(titzer): test MachineOperatorReducer for ChangeInt32ToFloat64
743 // TODO(titzer): test MachineOperatorReducer for ChangeFloat64ToInt32 744 // TODO(titzer): test MachineOperatorReducer for ChangeFloat64ToInt32
744 // TODO(titzer): test MachineOperatorReducer for Float64Compare 745 // TODO(titzer): test MachineOperatorReducer for Float64Compare
745 // TODO(titzer): test MachineOperatorReducer for Float64Add 746 // TODO(titzer): test MachineOperatorReducer for Float64Add
746 // TODO(titzer): test MachineOperatorReducer for Float64Sub 747 // TODO(titzer): test MachineOperatorReducer for Float64Sub
747 // TODO(titzer): test MachineOperatorReducer for Float64Mul 748 // TODO(titzer): test MachineOperatorReducer for Float64Mul
748 // TODO(titzer): test MachineOperatorReducer for Float64Div 749 // TODO(titzer): test MachineOperatorReducer for Float64Div
749 // TODO(titzer): test MachineOperatorReducer for Float64Mod 750 // TODO(titzer): test MachineOperatorReducer for Float64Mod
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | test/cctest/compiler/test-node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698