Index: test/cctest/compiler/test-control-reducer.cc |
diff --git a/test/cctest/compiler/test-control-reducer.cc b/test/cctest/compiler/test-control-reducer.cc |
index c4a1190281929da27d7ac91df50974db42ebfaec..26997246e65fd4b5705327eb8658e08cdb28c43e 100644 |
--- a/test/cctest/compiler/test-control-reducer.cc |
+++ b/test/cctest/compiler/test-control-reducer.cc |
@@ -1214,172 +1214,6 @@ TEST(CDeadLoop2) { |
} |
-TEST(CNonTermLoop1) { |
- ControlReducerTester R; |
- Node* loop = |
- R.SetSelfReferences(R.graph.NewNode(R.common.Loop(2), R.start, R.self)); |
- R.ReduceGraph(); |
- Node* end = R.graph.end(); |
- CheckLoop(loop, R.start, loop); |
- Node* merge = end->InputAt(0); |
- CheckMerge(merge, R.start, loop); |
-} |
- |
- |
-TEST(CNonTermLoop2) { |
- ControlReducerTester R; |
- Diamond d(R, R.p0); |
- Node* loop = R.SetSelfReferences( |
- R.graph.NewNode(R.common.Loop(2), d.if_false, R.self)); |
- d.merge->ReplaceInput(1, R.dead); |
- Node* end = R.graph.end(); |
- end->ReplaceInput(0, d.merge); |
- R.ReduceGraph(); |
- CHECK_EQ(end, R.graph.end()); |
- CheckLoop(loop, d.if_false, loop); |
- Node* merge = end->InputAt(0); |
- CheckMerge(merge, d.if_true, loop); |
-} |
- |
- |
-TEST(NonTermLoop3) { |
- ControlReducerTester R; |
- Node* loop = R.graph.NewNode(R.common.Loop(2), R.start, R.start); |
- Branch b(R, R.one, loop); |
- loop->ReplaceInput(1, b.if_true); |
- Node* end = R.graph.end(); |
- end->ReplaceInput(0, b.if_false); |
- |
- R.ReduceGraph(); |
- |
- CHECK_EQ(end, R.graph.end()); |
- CheckInputs(end, loop); |
- CheckInputs(loop, R.start, loop); |
-} |
- |
- |
-TEST(CNonTermLoop_terminate1) { |
- ControlReducerTester R; |
- Node* loop = R.graph.NewNode(R.common.Loop(2), R.start, R.start); |
- Node* effect = R.SetSelfReferences( |
- R.graph.NewNode(R.common.EffectPhi(2), R.start, R.self, loop)); |
- Branch b(R, R.one, loop); |
- loop->ReplaceInput(1, b.if_true); |
- Node* end = R.graph.end(); |
- end->ReplaceInput(0, b.if_false); |
- |
- R.ReduceGraph(); |
- |
- CHECK_EQ(end, R.graph.end()); |
- CheckLoop(loop, R.start, loop); |
- Node* terminate = end->InputAt(0); |
- CHECK_EQ(IrOpcode::kTerminate, terminate->opcode()); |
- CHECK_EQ(2, terminate->InputCount()); |
- CHECK_EQ(1, terminate->op()->EffectInputCount()); |
- CHECK_EQ(1, terminate->op()->ControlInputCount()); |
- CheckInputs(terminate, effect, loop); |
-} |
- |
- |
-TEST(CNonTermLoop_terminate2) { |
- ControlReducerTester R; |
- Node* loop = R.graph.NewNode(R.common.Loop(2), R.start, R.start); |
- Node* effect1 = R.SetSelfReferences( |
- R.graph.NewNode(R.common.EffectPhi(2), R.start, R.self, loop)); |
- Node* effect2 = R.SetSelfReferences( |
- R.graph.NewNode(R.common.EffectPhi(2), R.start, R.self, loop)); |
- Branch b(R, R.one, loop); |
- loop->ReplaceInput(1, b.if_true); |
- Node* end = R.graph.end(); |
- end->ReplaceInput(0, b.if_false); |
- |
- R.ReduceGraph(); |
- |
- CheckLoop(loop, R.start, loop); |
- CHECK_EQ(end, R.graph.end()); |
- Node* terminate = end->InputAt(0); |
- CHECK_EQ(IrOpcode::kTerminate, terminate->opcode()); |
- CHECK_EQ(3, terminate->InputCount()); |
- CHECK_EQ(2, terminate->op()->EffectInputCount()); |
- CHECK_EQ(1, terminate->op()->ControlInputCount()); |
- Node* e0 = terminate->InputAt(0); |
- Node* e1 = terminate->InputAt(1); |
- CHECK(e0 == effect1 || e1 == effect1); |
- CHECK(e0 == effect2 || e1 == effect2); |
- CHECK_EQ(loop, terminate->InputAt(2)); |
-} |
- |
- |
-TEST(CNonTermLoop_terminate_m1) { |
- ControlReducerTester R; |
- Node* loop = |
- R.SetSelfReferences(R.graph.NewNode(R.common.Loop(2), R.start, R.self)); |
- Node* effect = R.SetSelfReferences( |
- R.graph.NewNode(R.common.EffectPhi(2), R.start, R.self, loop)); |
- R.ReduceGraph(); |
- Node* end = R.graph.end(); |
- CHECK_EQ(R.start, loop->InputAt(0)); |
- CHECK_EQ(loop, loop->InputAt(1)); |
- Node* merge = end->InputAt(0); |
- CHECK_EQ(IrOpcode::kMerge, merge->opcode()); |
- CHECK_EQ(2, merge->InputCount()); |
- CHECK_EQ(2, merge->op()->ControlInputCount()); |
- CHECK_EQ(R.start, merge->InputAt(0)); |
- |
- Node* terminate = merge->InputAt(1); |
- CHECK_EQ(IrOpcode::kTerminate, terminate->opcode()); |
- CHECK_EQ(2, terminate->InputCount()); |
- CHECK_EQ(1, terminate->op()->EffectInputCount()); |
- CHECK_EQ(1, terminate->op()->ControlInputCount()); |
- CHECK_EQ(effect, terminate->InputAt(0)); |
- CHECK_EQ(loop, terminate->InputAt(1)); |
-} |
- |
- |
-TEST(CNonTermLoop_big1) { |
- ControlReducerTester R; |
- Branch b1(R, R.p0); |
- Node* rt = R.graph.NewNode(R.common.Return(), R.one, R.start, b1.if_true); |
- |
- Branch b2(R, R.p0, b1.if_false); |
- Node* rf = R.graph.NewNode(R.common.Return(), R.zero, R.start, b2.if_true); |
- Node* loop = R.SetSelfReferences( |
- R.graph.NewNode(R.common.Loop(2), b2.if_false, R.self)); |
- Node* merge = R.graph.NewNode(R.common.Merge(2), rt, rf); |
- R.end->ReplaceInput(0, merge); |
- |
- R.ReduceGraph(); |
- |
- CheckInputs(R.end, merge); |
- CheckInputs(merge, rt, rf, loop); |
- CheckInputs(loop, b2.if_false, loop); |
-} |
- |
- |
-TEST(CNonTermLoop_big2) { |
- ControlReducerTester R; |
- Branch b1(R, R.p0); |
- Node* rt = R.graph.NewNode(R.common.Return(), R.one, R.start, b1.if_true); |
- |
- Node* loop = R.graph.NewNode(R.common.Loop(2), b1.if_false, R.start); |
- Branch b2(R, R.zero, loop); |
- loop->ReplaceInput(1, b2.if_false); |
- Node* rf = R.graph.NewNode(R.common.Return(), R.zero, R.start, b2.if_true); |
- Node* merge = R.graph.NewNode(R.common.Merge(2), rt, rf); |
- R.end->ReplaceInput(0, merge); |
- |
- R.ReduceGraph(); |
- |
- Node* new_merge = R.end->InputAt(0); // old merge was reduced. |
- CHECK_NE(merge, new_merge); |
- CheckInputs(new_merge, rt, loop); |
- CheckInputs(loop, b1.if_false, loop); |
- CHECK(merge->IsDead()); |
- CHECK(rf->IsDead()); |
- CHECK(b2.if_true->IsDead()); |
-} |
- |
- |
TEST(Return1) { |
ControlReducerTester R; |
Node* ret = R.Return(R.one, R.start, R.start); |