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

Side by Side Diff: src/compiler/scheduler.cc

Issue 1846933002: [turbofan] Handle dead diamonds in scheduling and add a test. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/scheduler.h" 5 #include "src/compiler/scheduler.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "src/base/adapters.h" 9 #include "src/base/adapters.h"
10 #include "src/bit-vector.h" 10 #include "src/bit-vector.h"
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 : BasicBlock::GetCommonDominator(block, use_block); 1531 : BasicBlock::GetCommonDominator(block, use_block);
1532 } 1532 }
1533 return block; 1533 return block;
1534 } 1534 }
1535 1535
1536 BasicBlock* FindPredecessorBlock(Node* node) { 1536 BasicBlock* FindPredecessorBlock(Node* node) {
1537 return scheduler_->control_flow_builder_->FindPredecessorBlock(node); 1537 return scheduler_->control_flow_builder_->FindPredecessorBlock(node);
1538 } 1538 }
1539 1539
1540 BasicBlock* GetBlockForUse(Edge edge) { 1540 BasicBlock* GetBlockForUse(Edge edge) {
1541 // TODO(titzer): ignore uses from dead nodes (not visited in PrepareUses()).
1542 // Dead uses only occur if the graph is not trimmed before scheduling.
1541 Node* use = edge.from(); 1543 Node* use = edge.from();
1542 if (IrOpcode::IsPhiOpcode(use->opcode())) { 1544 if (IrOpcode::IsPhiOpcode(use->opcode())) {
1543 // If the use is from a coupled (i.e. floating) phi, compute the common 1545 // If the use is from a coupled (i.e. floating) phi, compute the common
1544 // dominator of its uses. This will not recurse more than one level. 1546 // dominator of its uses. This will not recurse more than one level.
1545 if (scheduler_->GetPlacement(use) == Scheduler::kCoupled) { 1547 if (scheduler_->GetPlacement(use) == Scheduler::kCoupled) {
1546 TRACE(" inspecting uses of coupled #%d:%s\n", use->id(), 1548 TRACE(" inspecting uses of coupled #%d:%s\n", use->id(),
1547 use->op()->mnemonic()); 1549 use->op()->mnemonic());
1548 DCHECK_EQ(edge.to(), NodeProperties::GetControlInput(use)); 1550 // TODO(titzer): reenable once above TODO is addressed.
1551 // DCHECK_EQ(edge.to(), NodeProperties::GetControlInput(use));
1549 return GetCommonDominatorOfUses(use); 1552 return GetCommonDominatorOfUses(use);
1550 } 1553 }
1551 // If the use is from a fixed (i.e. non-floating) phi, we use the 1554 // If the use is from a fixed (i.e. non-floating) phi, we use the
1552 // predecessor block of the corresponding control input to the merge. 1555 // predecessor block of the corresponding control input to the merge.
1553 if (scheduler_->GetPlacement(use) == Scheduler::kFixed) { 1556 if (scheduler_->GetPlacement(use) == Scheduler::kFixed) {
1554 TRACE(" input@%d into a fixed phi #%d:%s\n", edge.index(), use->id(), 1557 TRACE(" input@%d into a fixed phi #%d:%s\n", edge.index(), use->id(),
1555 use->op()->mnemonic()); 1558 use->op()->mnemonic());
1556 Node* merge = NodeProperties::GetControlInput(use, 0); 1559 Node* merge = NodeProperties::GetControlInput(use, 0);
1557 DCHECK(IrOpcode::IsMergeOpcode(merge->opcode())); 1560 DCHECK(IrOpcode::IsMergeOpcode(merge->opcode()));
1558 Node* input = NodeProperties::GetControlInput(merge, edge.index()); 1561 Node* input = NodeProperties::GetControlInput(merge, edge.index());
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 for (Node* const node : *nodes) { 1737 for (Node* const node : *nodes) {
1735 schedule_->SetBlockForNode(to, node); 1738 schedule_->SetBlockForNode(to, node);
1736 scheduled_nodes_[to->id().ToSize()].push_back(node); 1739 scheduled_nodes_[to->id().ToSize()].push_back(node);
1737 } 1740 }
1738 nodes->clear(); 1741 nodes->clear();
1739 } 1742 }
1740 1743
1741 } // namespace compiler 1744 } // namespace compiler
1742 } // namespace internal 1745 } // namespace internal
1743 } // namespace v8 1746 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698