[turbofan] Fix typo in ControlReducer.
R=svenpanne@chromium.org Review URL: https://codereview.chromium.org/1001063003 Cr-Commit-Position: refs/heads/master@{#27201}
This commit is contained in:
parent
bab55d24ae
commit
523dec1234
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user