Commit 3e6952c9 authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

Revert "[turbofan] re-wire Unreachable to the graph end at EffectPhi's"

This reverts commit 2c0b1f6e.

Reason for revert: Seems to cause GC stress failures blocking LKGR:
https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20gc%20stress/22453
https://ci.chromium.org/p/v8/builders/ci/V8%20Mac64%20GC%20Stress/7318

Original change's description:
> [turbofan] re-wire Unreachable to the graph end at EffectPhi's
> 
> This avoids the EffectControlLinearizer stumbling upon unreachable
> code.
> 
> Bug: chromium:958718
> Change-Id: I135c17813741e48e878a4624370eee1e06081031
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1605737
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61434}

TBR=jarin@chromium.org,tebbi@chromium.org

Change-Id: I85cf33f06617b15cdd435e2699ace99e532d26e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:958718
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1607655Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61436}
parent 848e1b9a
......@@ -61,7 +61,7 @@ Reduction DeadCodeElimination::Reduce(Node* node) {
case IrOpcode::kPhi:
return ReducePhi(node);
case IrOpcode::kEffectPhi:
return ReduceEffectPhi(node);
return PropagateDeadControl(node);
case IrOpcode::kDeoptimize:
case IrOpcode::kReturn:
case IrOpcode::kTerminate:
......@@ -109,6 +109,7 @@ Reduction DeadCodeElimination::ReduceEnd(Node* node) {
return NoChange();
}
Reduction DeadCodeElimination::ReduceLoopOrMerge(Node* node) {
DCHECK(IrOpcode::IsMergeOpcode(node->opcode()));
Node::Inputs inputs = node->inputs();
......@@ -232,36 +233,6 @@ Reduction DeadCodeElimination::ReducePhi(Node* node) {
return NoChange();
}
Reduction DeadCodeElimination::ReduceEffectPhi(Node* node) {
DCHECK_EQ(IrOpcode::kEffectPhi, node->opcode());
Reduction reduction = PropagateDeadControl(node);
if (reduction.Changed()) return reduction;
Node* merge = NodeProperties::GetControlInput(node);
DCHECK(merge->opcode() == IrOpcode::kMerge ||
merge->opcode() == IrOpcode::kLoop);
int input_count = node->op()->EffectInputCount();
for (int i = 0; i < input_count; ++i) {
Node* effect = NodeProperties::GetEffectInput(node, i);
if (effect->opcode() == IrOpcode::kUnreachable) {
// If Unreachable hits an effect phi, we can re-connect the effect chain
// to the graph end and delete the corresponding inputs from the merge and
// phi nodes.
Node* control = NodeProperties::GetControlInput(merge, i);
Node* throw_node = graph_->NewNode(common_->Throw(), effect, control);
NodeProperties::MergeControlToEnd(graph_, common_, throw_node);
// Only remove the value uses of the Unreachable node, since other Throw
// nodes might already have the Unreachable node as an input.
ReplaceWithValue(effect, dead_, effect);
NodeProperties::ReplaceEffectInput(node, dead_, i);
NodeProperties::ReplaceControlInput(merge, dead_, i);
Revisit(merge);
reduction = Changed(node);
}
}
return reduction;
}
Reduction DeadCodeElimination::ReducePureNode(Node* node) {
DCHECK_EQ(0, node->op()->EffectInputCount());
if (node->opcode() == IrOpcode::kDeadValue) return NoChange();
......
......@@ -53,7 +53,6 @@ class V8_EXPORT_PRIVATE DeadCodeElimination final
Reduction ReduceLoopExit(Node* node);
Reduction ReduceNode(Node* node);
Reduction ReducePhi(Node* node);
Reduction ReduceEffectPhi(Node* node);
Reduction ReducePureNode(Node* node);
Reduction ReduceUnreachableOrIfException(Node* node);
Reduction ReduceEffectNode(Node* node);
......
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