From 14f81dd2d25508e299e392d1fad176e2c825f9d1 Mon Sep 17 00:00:00 2001 From: tebbi Date: Wed, 23 Nov 2016 21:49:27 -0800 Subject: [PATCH] [turbofan] Fixed divergence in escape analysis. This fixes a bug where the re-creation of phi nodes leads to divergence. The fix makes sure that once a node created a phi node, it sticks to it and does not forget about it, even if the inputs suddenly agree again. The bug appeared on the trybots in https://codereview.chromium.org/2512733003/. Also I added a line to mark effect phi nodes on the queue. This is unrelated, but seems to be an obvious ommission. R=bmeurer@chromium.org BUG=v8:5633 Review-Url: https://codereview.chromium.org/2522253002 Cr-Commit-Position: refs/heads/master@{#41239} --- src/compiler/escape-analysis.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/escape-analysis.cc b/src/compiler/escape-analysis.cc index 0218045971..def99764dc 100644 --- a/src/compiler/escape-analysis.cc +++ b/src/compiler/escape-analysis.cc @@ -476,7 +476,8 @@ bool VirtualObject::MergeFrom(MergeCache* cache, Node* at, Graph* graph, at->opcode() == IrOpcode::kPhi); bool changed = false; for (size_t i = 0; i < field_count(); ++i) { - if (Node* field = cache->GetFields(i)) { + Node* field = cache->GetFields(i); + if (field && !IsCreatedPhi(i)) { changed = changed || GetField(i) != field; SetField(i, field); TRACE(" Field %zu agree on rep #%d\n", i, field->id()); @@ -966,6 +967,7 @@ void EscapeAnalysis::RunObjectAnalysis() { // VirtualObjects, and we want to delay phis to improve performance. if (use->opcode() == IrOpcode::kEffectPhi) { if (!status_analysis_->IsInQueue(use->id())) { + status_analysis_->SetInQueue(use->id(), true); queue.push_front(use); } } else if ((use->opcode() != IrOpcode::kLoadField &&