Commit 523dec12 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Fix typo in ControlReducer.

R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/1001063003

Cr-Commit-Position: refs/heads/master@{#27201}
parent bab55d24
...@@ -547,8 +547,8 @@ class ControlReducerImpl { ...@@ -547,8 +547,8 @@ class ControlReducerImpl {
Node* node1 = node->InputAt(1); Node* node1 = node->InputAt(1);
if (((node0->opcode() == IrOpcode::kIfTrue && if (((node0->opcode() == IrOpcode::kIfTrue &&
node1->opcode() == IrOpcode::kIfFalse) || node1->opcode() == IrOpcode::kIfFalse) ||
(node0->opcode() == IrOpcode::kIfTrue && (node1->opcode() == IrOpcode::kIfTrue &&
node1->opcode() == IrOpcode::kIfFalse)) && node0->opcode() == IrOpcode::kIfFalse)) &&
node0->OwnedBy(node) && node1->OwnedBy(node)) { node0->OwnedBy(node) && node1->OwnedBy(node)) {
Node* branch0 = NodeProperties::GetControlInput(node0); Node* branch0 = NodeProperties::GetControlInput(node0);
Node* branch1 = NodeProperties::GetControlInput(node1); Node* branch1 = NodeProperties::GetControlInput(node1);
......
...@@ -1189,11 +1189,25 @@ TEST(CNestedDiamonds_xyz) { ...@@ -1189,11 +1189,25 @@ TEST(CNestedDiamonds_xyz) {
} }
TEST(CDeadDiamond) { TEST(CUnusedDiamond1) {
ControlReducerTester R; ControlReducerTester R;
// if (p0) { } else { } // if (p0) { } else { }
Diamond d(R, R.p0); Node* branch = R.graph.NewNode(R.common.Branch(), R.p0, R.start);
R.ReduceMergeIterative(R.start, d.merge); Node* if_true = R.graph.NewNode(R.common.IfTrue(), branch);
Node* if_false = R.graph.NewNode(R.common.IfFalse(), branch);
Node* merge = R.graph.NewNode(R.common.Merge(2), if_true, if_false);
R.ReduceMergeIterative(R.start, merge);
}
TEST(CUnusedDiamond2) {
ControlReducerTester R;
// if (p0) { } else { }
Node* branch = R.graph.NewNode(R.common.Branch(), R.p0, R.start);
Node* if_true = R.graph.NewNode(R.common.IfTrue(), branch);
Node* if_false = R.graph.NewNode(R.common.IfFalse(), branch);
Node* merge = R.graph.NewNode(R.common.Merge(2), if_false, if_true);
R.ReduceMergeIterative(R.start, merge);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment