[turbofan] Disable TypedOptimization for loop-related Phi nodes

TypeNarrowing and TypedOptimization can successively narrow range types of loop variables. In the presence of new, precise information on such loop variables, e.g. due to load elimination, many such narrowing steps are necessary, however, leading to very slow convergence of optimizations and an explosion in memory consumption. Until we have a sound way of speeding this process up, we disable TypedOptimization on loop-related Phi nodes.

R=bmeurer@chromium.org, mvstanton@chromium.org

Bug: chromium:978750
Change-Id: Ibce7db69807d2c1bc6a56c2f0287440bec0ce04b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1687892
Commit-Queue: Georg Schmid <gsps@google.com>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62513}
This commit is contained in:
Georg Schmid 2019-07-03 16:42:21 +02:00 committed by Commit Bot
parent bdf7fea466
commit 6eed6cc088

View File

@ -329,6 +329,12 @@ Reduction TypedOptimization::ReducePhi(Node* node) {
// after lowering based on types, i.e. a SpeculativeNumberAdd has a more
// precise type than the JSAdd that was in the graph when the Typer was run.
DCHECK_EQ(IrOpcode::kPhi, node->opcode());
// Prevent new types from being propagated through loop-related Phis for now.
// This is to avoid slow convergence of type narrowing when we learn very
// precise information about loop variables.
if (NodeProperties::GetControlInput(node, 0)->opcode() == IrOpcode::kLoop) {
return NoChange();
}
int arity = node->op()->ValueInputCount();
Type type = NodeProperties::GetType(node->InputAt(0));
for (int i = 1; i < arity; ++i) {