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

Unified Diff: test/cctest/compiler/test-osr.cc

Issue 1368913002: [turbofan] Check node input/use consistency for changed operators and new nodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweak Created 5 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 side-by-side diff with in-line comments
Download patch
Index: test/cctest/compiler/test-osr.cc
diff --git a/test/cctest/compiler/test-osr.cc b/test/cctest/compiler/test-osr.cc
index 80dbccc633f7191759505a8c6e9e97dd19abd1b3..356cbd24a7f7527fc75f8fd7143966d2e595fc9d 100644
--- a/test/cctest/compiler/test-osr.cc
+++ b/test/cctest/compiler/test-osr.cc
@@ -93,22 +93,16 @@ class OsrDeconstructorTester : public HandleAndZoneScope {
return graph.NewNode(common.Phi(kMachAnyTagged, count), count + 1, inputs);
}
- Node* NewLoop(bool is_osr, int num_backedges, Node* entry = NULL) {
- CHECK_LT(num_backedges, 4);
- CHECK_GE(num_backedges, 0);
- int count = 1 + num_backedges;
- if (entry == NULL) entry = osr_normal_entry;
- Node* inputs[5] = {entry, self, self, self, self};
+ Node* NewLoop(bool is_osr, int num_backedges, Node* entry = nullptr) {
+ if (entry == nullptr) entry = osr_normal_entry;
+ Node* loop = graph.NewNode(common.Loop(1), entry);
if (is_osr) {
- count = 2 + num_backedges;
- inputs[1] = osr_loop_entry;
+ loop->AppendInput(graph.zone(), osr_loop_entry);
}
-
- Node* loop = graph.NewNode(common.Loop(count), count, inputs);
- for (int i = 0; i < loop->InputCount(); i++) {
- if (loop->InputAt(i) == self) loop->ReplaceInput(i, loop);
+ for (int i = 0; i < num_backedges; i++) {
+ loop->AppendInput(graph.zone(), loop);
}
-
+ NodeProperties::ChangeOp(loop, common.Loop(loop->InputCount()));
return loop;
}
@@ -497,8 +491,7 @@ TEST(Deconstruct_osr_nested3) {
loop0.branch->ReplaceInput(0, loop0_cntr);
// middle loop.
- Node* loop1 = T.graph.NewNode(T.common.Loop(2), loop0.if_true, T.self);
- loop1->ReplaceInput(0, loop0.if_true);
+ Node* loop1 = T.graph.NewNode(T.common.Loop(1), loop0.if_true);
Node* loop1_phi = T.graph.NewNode(T.common.Phi(kMachAnyTagged, 2), loop0_cntr,
loop0_cntr, loop1);
@@ -521,7 +514,8 @@ TEST(Deconstruct_osr_nested3) {
Node* if_false = T.graph.NewNode(T.common.IfFalse(), branch);
loop0.loop->ReplaceInput(1, if_true);
- loop1->ReplaceInput(1, if_false);
+ loop1->AppendInput(T.graph.zone(), if_false);
+ NodeProperties::ChangeOp(loop1, T.common.Loop(2));
Node* ret =
T.graph.NewNode(T.common.Return(), loop0_cntr, T.start, loop0.exit);
« no previous file with comments | « test/cctest/compiler/test-machine-operator-reducer.cc ('k') | test/unittests/compiler/control-equivalence-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698