Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[turbofan] Always defer replacement in simplified lowering.
Browse files Browse the repository at this point in the history
Since we do negative type checks, the current shortcut might still affect
the lowering choices, possibly leading to inconsistent results.

This CL gets rid of the shortcut.

Review-Url: https://codereview.chromium.org/2101943005
Cr-Commit-Position: refs/heads/master@{#37412}
  • Loading branch information
jaro-sevcik authored and Commit bot committed Jun 30, 2016
1 parent 561be7b commit 10714b6
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/compiler/simplified-lowering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2102,20 +2102,9 @@ class RepresentationSelector {
DCHECK_EQ(0, node->op()->ControlInputCount());
}

if (replacement->id() < count_ &&
GetUpperBound(node)->Is(GetUpperBound(replacement)) &&
TypeOf(node)->Is(TypeOf(replacement))) {
// Replace with a previously existing node eagerly only if the type is the
// same.
node->ReplaceUses(replacement);
} else {
// Otherwise, we are replacing a node with a representation change.
// Such a substitution must be done after all lowering is done, because
// changing the type could confuse the representation change
// insertion for uses of the node.
replacements_.push_back(node);
replacements_.push_back(replacement);
}
replacements_.push_back(node);
replacements_.push_back(replacement);

node->NullAllInputs(); // Node is now dead.
}

Expand Down

0 comments on commit 10714b6

Please sign in to comment.