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

Unified Diff: runtime/vm/flow_graph_optimizer.h

Issue 261823005: Optimize conditional branches that have same true/false targets. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.h
===================================================================
--- runtime/vm/flow_graph_optimizer.h (revision 35649)
+++ runtime/vm/flow_graph_optimizer.h (working copy)
@@ -297,8 +297,16 @@
static void Optimize(FlowGraph* graph);
- // Only visit branches to optimize away unreachable blocks discovered
- // by range analysis.
+ // (1) Visit branches to optimize away unreachable blocks discovered by range
+ // analysis.
+ // (2) Eliminate branches that have the same true- and false-target: For
+ // example, this occurs after expressions like
+ //
+ // if (a == null || b == null) {
+ // ...
+ // }
+ //
+ // where b is known to be null.
static void OptimizeBranches(FlowGraph* graph);
// Used to initialize the abstract value of definitions.
@@ -308,6 +316,7 @@
void Analyze();
void VisitBranches();
void Transform();
+ void EliminateRedundantBranches();
void SetReachable(BlockEntryInstr* block);
void SetValue(Definition* definition, const Object& value);
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698