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

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

Issue 917383004: [turbofan] Fix control reducer with re-reducing branches. (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 | « no previous file | src/compiler/graph-visualizer.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 105bdfe2017115dc2c0a82cc62147b5ed146692d..9d74b8a6a4fb001f26f581b55c80019631cd0cd4 100644
--- a/src/compiler/control-reducer.cc
+++ b/src/compiler/control-reducer.cc
@@ -400,6 +400,8 @@ class ControlReducerImpl {
// Reduce branches, phis, and merges.
switch (node->opcode()) {
+ case IrOpcode::kBranch:
+ return ReduceBranch(node);
case IrOpcode::kIfTrue:
return ReduceIfTrue(node);
case IrOpcode::kIfFalse:
@@ -478,6 +480,14 @@ class ControlReducerImpl {
return replacement == NULL ? dead() : replacement;
}
+ // Reduce branches.
+ Node* ReduceBranch(Node* branch) {
+ if (DecideCondition(branch->InputAt(0)) != kUnknown) {
+ for (Node* use : branch->uses()) Revisit(use);
+ }
+ return branch;
+ }
+
// Reduce merges by trimming away dead inputs from the merge and phis.
Node* ReduceMerge(Node* node) {
// Count the number of live inputs.
« no previous file with comments | « no previous file | src/compiler/graph-visualizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698