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

Unified Diff: runtime/vm/flow_graph_optimizer.h

Issue 12218181: Recognize pattern (a << b) & c with c being a positive Smi and allow left shift to truncate the res… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
Index: runtime/vm/flow_graph_optimizer.h
===================================================================
--- runtime/vm/flow_graph_optimizer.h (revision 18774)
+++ runtime/vm/flow_graph_optimizer.h (working copy)
@@ -27,6 +27,10 @@
// Use propagated class ids to optimize, replace or eliminate instructions.
void ApplyClassIds();
+ // Optimize (a << b) & c pattern: if c is a positive smi, then the
+ // shift can be a truncating Smi shift and result is always Smi.
+ void TryOptimizeLeftShiftWithBitAndPattern();
+
void Canonicalize();
void EliminateDeadPhis();
@@ -132,6 +136,10 @@
void HandleEqualityCompare(EqualityCompareInstr* comp,
T current_instruction);
+ void OptimizeLeftShiftBitAndSmiOp(Definition* bit_and_instr,
+ Value* left,
+ Value* right);
+
FlowGraph* flow_graph_;
DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer);

Powered by Google App Engine
This is Rietveld 408576698