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

Unified Diff: src/compiler/control-reducer.cc

Issue 830923002: Do not reduce effect phis of loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added a comment Created 5 years, 12 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-ntl-effect.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/control-reducer.cc
diff --git a/src/compiler/control-reducer.cc b/src/compiler/control-reducer.cc
index e738ccf24e82f874447cb4584a78b8c488e71a57..acb2f06b04ea116e9c1ccbbf08978e72ae49d532 100644
--- a/src/compiler/control-reducer.cc
+++ b/src/compiler/control-reducer.cc
@@ -403,6 +403,14 @@ class ControlReducerImpl {
if (n <= 1) return dead(); // No non-control inputs.
if (n == 2) return node->InputAt(0); // Only one non-control input.
+ // Never remove an effect phi from a (potentially non-terminating) loop.
+ // Otherwise, we might end up eliminating effect nodes, such as calls,
+ // before the loop.
+ if (node->opcode() == IrOpcode::kEffectPhi &&
+ NodeProperties::GetControlInput(node)->opcode() == IrOpcode::kLoop) {
+ return node;
+ }
+
Node* replacement = NULL;
Node::Inputs inputs = node->inputs();
for (InputIter it = inputs.begin(); n > 1; --n, ++it) {
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-ntl-effect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698