Commit d4ddf645 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[turbofan] fix bug in DeadCodeElimination

Bug: chromium:1076708
Change-Id: I88a5eae0e562e32f1915deff3c4150ec4be14c6c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2181266
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67564}
parent 783faf65
...@@ -317,7 +317,10 @@ Reduction DeadCodeElimination::ReduceDeoptimizeOrReturnOrTerminateOrTailCall( ...@@ -317,7 +317,10 @@ Reduction DeadCodeElimination::ReduceDeoptimizeOrReturnOrTerminateOrTailCall(
node->opcode() == IrOpcode::kTailCall); node->opcode() == IrOpcode::kTailCall);
Reduction reduction = PropagateDeadControl(node); Reduction reduction = PropagateDeadControl(node);
if (reduction.Changed()) return reduction; if (reduction.Changed()) return reduction;
if (FindDeadInput(node) != nullptr) { // Terminate nodes are not part of actual control flow, so they should never
// be replaced with Throw.
if (node->opcode() != IrOpcode::kTerminate &&
FindDeadInput(node) != nullptr) {
Node* effect = NodeProperties::GetEffectInput(node, 0); Node* effect = NodeProperties::GetEffectInput(node, 0);
Node* control = NodeProperties::GetControlInput(node, 0); Node* control = NodeProperties::GetControlInput(node, 0);
if (effect->opcode() != IrOpcode::kUnreachable) { if (effect->opcode() != IrOpcode::kUnreachable) {
......
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