Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: src/compiler/effect-control-linearizer.cc

Issue 2159603002: [turbofan] In effect control linearizer, only delay effect phi update for loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comment Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-628403.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/effect-control-linearizer.cc
diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc
index 292d4d58e2731584b72a1550f794e27953200d7b..8701c1923b80c8121efcb371af360bf8eb4fd21d 100644
--- a/src/compiler/effect-control-linearizer.cc
+++ b/src/compiler/effect-control-linearizer.cc
@@ -378,13 +378,17 @@ void EffectControlLinearizer::Run() {
// The input blocks do not have the same effect. We have
// to create an effect phi node.
inputs_buffer.clear();
- inputs_buffer.resize(block->PredecessorCount(), graph()->start());
+ inputs_buffer.resize(block->PredecessorCount(), jsgraph()->Dead());
Benedikt Meurer 2016/07/16 12:35:29 Nice!
inputs_buffer.push_back(control);
effect = graph()->NewNode(
common()->EffectPhi(static_cast<int>(block->PredecessorCount())),
static_cast<int>(inputs_buffer.size()), &(inputs_buffer.front()));
- // Let us update the effect phi node later.
- pending_effect_phis.push_back(PendingEffectPhi(effect, block));
+ // For loops, we update the effect phi node later to break cycles.
+ if (control->opcode() == IrOpcode::kLoop) {
+ pending_effect_phis.push_back(PendingEffectPhi(effect, block));
+ } else {
+ UpdateEffectPhi(effect, block, &block_effects);
+ }
} else if (control->opcode() == IrOpcode::kIfException) {
// The IfException is connected into the effect chain, so we need
// to update the effect here.
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-628403.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698