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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1155683004: [turbofan] Connect loops to end via Terminate during graph building. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Also remove redundant EffectPhis now. Created 5 years, 7 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 | src/compiler/common-operator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 8d0a465bbc07af19878710502914f4c593ffb175..0b60bd03ffdc937f08d51ee5036da77b62c4e049 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -3660,6 +3660,14 @@ void AstGraphBuilder::Environment::PrepareForLoop(BitVector* assigned,
Node* effect = builder_->NewEffectPhi(1, GetEffectDependency(), control);
UpdateEffectDependency(effect);
+ // Connect the loop to end via Terminate if it's not marked as unreachable.
+ if (!IsMarkedAsUnreachable()) {
+ // Connect the Loop node to end via a Terminate node.
+ Node* terminate = builder_->graph()->NewNode(
+ builder_->common()->Terminate(), effect, control);
+ builder_->exit_controls_.push_back(terminate);
+ }
+
if (builder_->info()->is_osr()) {
// Introduce phis for all context values in the case of an OSR graph.
for (int i = 0; i < static_cast<int>(contexts()->size()); ++i) {
« no previous file with comments | « no previous file | src/compiler/common-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698