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 {
Node* node1 = node->InputAt(1);
if (((node0->opcode() == IrOpcode::kIfTrue &&
node1->opcode() == IrOpcode::kIfFalse) ||
(node0->opcode() == IrOpcode::kIfTrue &&
node1->opcode() == IrOpcode::kIfFalse)) &&
(node1->opcode() == IrOpcode::kIfTrue &&
node0->opcode() == IrOpcode::kIfFalse)) &&
node0->OwnedBy(node) && node1->OwnedBy(node)) {
Node* branch0 = NodeProperties::GetControlInput(node0);
Node* branch1 = NodeProperties::GetControlInput(node1);
......
......@@ -1189,11 +1189,25 @@ TEST(CNestedDiamonds_xyz) {
}
TEST(CDeadDiamond) {
TEST(CUnusedDiamond1) {
ControlReducerTester R;
// if (p0) { } else { }
Diamond d(R, R.p0);
R.ReduceMergeIterative(R.start, d.merge);
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_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