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

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

Issue 920573004: [turbofan] Fix control reducer for dead loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « src/compiler/control-reducer.h ('k') | src/compiler/osr.cc » ('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 7f97254b372bf0c4c9a16fbddefd9a0938ca7acd..df302dd8ed838f37c6d7045cdea78d2be6b1c3b5 100644
--- a/src/compiler/control-reducer.cc
+++ b/src/compiler/control-reducer.cc
@@ -384,7 +384,8 @@ class ControlReducerImpl {
// Reducer implementation: perform reductions on a node.
//===========================================================================
Node* ReduceNode(Node* node) {
- if (node->op()->ControlInputCount() == 1) {
+ if (node->op()->ControlInputCount() == 1 ||
+ node->opcode() == IrOpcode::kLoop) {
// If a node has only one control input and it is dead, replace with dead.
Node* control = NodeProperties::GetControlInput(node);
if (control->opcode() == IrOpcode::kDead) {
@@ -611,21 +612,20 @@ void ControlReducer::TrimGraph(Zone* zone, JSGraph* jsgraph) {
}
-Node* ControlReducer::ReducePhiForTesting(JSGraph* jsgraph,
- CommonOperatorBuilder* common,
- Node* node) {
+Node* ControlReducer::ReduceMerge(JSGraph* jsgraph,
+ CommonOperatorBuilder* common, Node* node) {
Zone zone;
ControlReducerImpl impl(&zone, jsgraph, common);
- return impl.ReducePhi(node);
+ return impl.ReduceMerge(node);
}
-Node* ControlReducer::ReduceMergeForTesting(JSGraph* jsgraph,
- CommonOperatorBuilder* common,
- Node* node) {
+Node* ControlReducer::ReducePhiForTesting(JSGraph* jsgraph,
+ CommonOperatorBuilder* common,
+ Node* node) {
Zone zone;
ControlReducerImpl impl(&zone, jsgraph, common);
- return impl.ReduceMerge(node);
+ return impl.ReducePhi(node);
}
« no previous file with comments | « src/compiler/control-reducer.h ('k') | src/compiler/osr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698