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

Side by Side Diff: test/unittests/compiler/int64-lowering-unittest.cc

Issue 2511503002: [wasm] Break a cycle with a loop node in the int64-lowering. (Closed)
Patch Set: Add a test Created 4 years, 1 month 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/int64-lowering.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/int64-lowering.h" 5 #include "src/compiler/int64-lowering.h"
6 #include "src/compiler/common-operator.h" 6 #include "src/compiler/common-operator.h"
7 #include "src/compiler/linkage.h" 7 #include "src/compiler/linkage.h"
8 #include "src/compiler/machine-operator.h" 8 #include "src/compiler/machine-operator.h"
9 #include "src/compiler/node.h" 9 #include "src/compiler/node.h"
10 10
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 Node* store = 868 Node* store =
869 graph()->NewNode(machine()->Store(store_rep), Int64Constant(value(0)), 869 graph()->NewNode(machine()->Store(store_rep), Int64Constant(value(0)),
870 Int64Constant(value(1)), load, load, graph()->start()); 870 Int64Constant(value(1)), load, load, graph()->start());
871 871
872 eff_phi->InsertInput(zone(), 1, store); 872 eff_phi->InsertInput(zone(), 1, store);
873 NodeProperties::ChangeOp(eff_phi, 873 NodeProperties::ChangeOp(eff_phi,
874 common()->ResizeMergeOrPhi(eff_phi->op(), 2)); 874 common()->ResizeMergeOrPhi(eff_phi->op(), 2));
875 875
876 LowerGraph(load, MachineRepresentation::kWord64); 876 LowerGraph(load, MachineRepresentation::kWord64);
877 } 877 }
878
879 TEST_F(Int64LoweringTest, LoopCycle) {
880 // New node with two placeholders.
881 Node* compare = graph()->NewNode(machine()->Word64Equal(), Int64Constant(0),
882 Int64Constant(value(0)));
883
884 Node* load = graph()->NewNode(
885 machine()->Load(MachineType::Int64()), Int64Constant(value(1)),
886 Int64Constant(value(2)), graph()->start(),
887 graph()->NewNode(
888 common()->Loop(2), graph()->start(),
889 graph()->NewNode(common()->IfFalse(),
890 graph()->NewNode(common()->Branch(), compare,
891 graph()->start()))));
892
893 NodeProperties::ReplaceValueInput(compare, load, 0);
894
895 LowerGraph(load, MachineRepresentation::kWord64);
896 }
878 } // namespace compiler 897 } // namespace compiler
879 } // namespace internal 898 } // namespace internal
880 } // namespace v8 899 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/int64-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698