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

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

Issue 1138463004: [turbofan] Fix handling of OsrLoopEntry in ControlReducer::ConnectNTL() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | test/mjsunit/regress/regress-469605b.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 6f7ffb3da38481fa9a896cf1e190638737b241d9..6910e6c043b61b7e0e7499fff520b8c9d4d6933d 100644
--- a/src/compiler/control-reducer.cc
+++ b/src/compiler/control-reducer.cc
@@ -90,11 +90,10 @@ class ControlReducerImpl final : public AdvancedReducer {
bool pop = true;
while (fw_stack.back().second != node->use_edges().end()) {
Edge edge = *(fw_stack.back().second);
+ Node* succ = edge.from();
if (NodeProperties::IsControlEdge(edge) &&
- edge.from()->op()->ControlOutputCount() > 0) {
+ succ->op()->ControlOutputCount() > 0) {
// Only walk control edges to control nodes.
- Node* succ = edge.from();
-
if (marked.IsOnStack(succ) && !marked.IsReachableFromEnd(succ)) {
// {succ} is on stack and not reachable from end.
Node* added = ConnectNTL(succ);
@@ -112,11 +111,14 @@ class ControlReducerImpl final : public AdvancedReducer {
}
if (!marked.IsReachableFromStart(succ)) {
// {succ} is not yet reached from start.
- marked.Push(succ);
marked.SetReachableFromStart(succ);
- fw_stack.push_back(FwIter(succ, succ->use_edges().begin()));
- pop = false; // "recurse" into successor control node.
- break;
+ if (succ->opcode() != IrOpcode::kOsrLoopEntry) {
+ // Skip OsrLoopEntry; forms a confusing irredducible loop.
+ marked.Push(succ);
+ fw_stack.push_back(FwIter(succ, succ->use_edges().begin()));
+ pop = false; // "recurse" into successor control node.
+ break;
+ }
}
}
++fw_stack.back().second;
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-469605b.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698