Fix scheduler not to connect final merge block in the graph to its inputs.
R=mstarzinger@chromium.org BUG= Review URL: https://codereview.chromium.org/667953002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24780 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
1c5fafe890
commit
0c4f8bc6c4
@ -283,6 +283,9 @@ class CFGBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConnectMerge(Node* merge) {
|
void ConnectMerge(Node* merge) {
|
||||||
|
// Don't connect the special merge at the end to its predecessors.
|
||||||
|
if (IsFinalMerge(merge)) return;
|
||||||
|
|
||||||
BasicBlock* block = schedule_->block(merge);
|
BasicBlock* block = schedule_->block(merge);
|
||||||
DCHECK(block != NULL);
|
DCHECK(block != NULL);
|
||||||
// For all of the merge's control inputs, add a goto at the end to the
|
// For all of the merge's control inputs, add a goto at the end to the
|
||||||
@ -290,10 +293,8 @@ class CFGBuilder {
|
|||||||
for (InputIter j = merge->inputs().begin(); j != merge->inputs().end();
|
for (InputIter j = merge->inputs().begin(); j != merge->inputs().end();
|
||||||
++j) {
|
++j) {
|
||||||
BasicBlock* predecessor_block = schedule_->block(*j);
|
BasicBlock* predecessor_block = schedule_->block(*j);
|
||||||
if ((*j)->opcode() != IrOpcode::kReturn) {
|
TraceConnect(merge, predecessor_block, block);
|
||||||
TraceConnect(merge, predecessor_block, block);
|
schedule_->AddGoto(predecessor_block, block);
|
||||||
schedule_->AddGoto(predecessor_block, block);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,6 +315,10 @@ class CFGBuilder {
|
|||||||
block->id().ToInt(), succ->id().ToInt());
|
block->id().ToInt(), succ->id().ToInt());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsFinalMerge(Node* node) {
|
||||||
|
return (node == scheduler_->graph_->end()->InputAt(0));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user