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

Unified Diff: runtime/vm/flow_graph_optimizer.h

Issue 10871060: Reland "Add a simple dominator based redundancy elimination" and fix a register allocation bug. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/flow_graph_allocator.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 11229)
+++ runtime/vm/flow_graph_optimizer.h (working copy)
@@ -11,6 +11,7 @@
namespace dart {
template <typename T> class GrowableArray;
+template <typename T> class DirectChainedHashMap;
class FlowGraphOptimizer : public FlowGraphVisitor {
public:
@@ -105,17 +106,16 @@
};
-class LocalCSE : public ValueObject {
+// A simple common subexpression elimination based
+// on the dominator tree.
+class DominatorBasedCSE : public AllStatic {
public:
- explicit LocalCSE(const FlowGraph& flow_graph)
- : blocks_(flow_graph.reverse_postorder()) { }
+ static void Optimize(BlockEntryInstr* graph_entry);
- void Optimize();
-
private:
- const GrowableArray<BlockEntryInstr*>& blocks_;
-
- DISALLOW_COPY_AND_ASSIGN(LocalCSE);
+ static void OptimizeRecursive(
+ BlockEntryInstr* entry,
+ DirectChainedHashMap<BindInstr*>* map);
};
« no previous file with comments | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698