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

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
« 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 18843)
+++ runtime/vm/flow_graph_optimizer.h (working copy)
@@ -29,6 +29,10 @@
// Use propagated class ids to optimize, replace or eliminate instructions.
void ApplyClassIds();
+ // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the
+ // shift can be a truncating Smi shift-left and result is always Smi.
+ void TryOptimizeLeftShiftWithBitAndPattern();
+
void Canonicalize();
void EliminateDeadPhis();
@@ -97,6 +101,12 @@
Environment* deopt_environment,
Instruction* insert_before);
+ // Insert a Smi check if needed.
+ void AddCheckSmi(Definition* to_check,
+ intptr_t deopt_id,
+ Environment* deopt_environment,
+ Instruction* insert_before);
+
// Add a class check for a call's first argument immediately before the
// call, using the call's IC data to determine the check, and the call's
// deopt ID and deoptimization environment if the check fails.
@@ -138,6 +148,10 @@
void HandleEqualityCompare(EqualityCompareInstr* comp,
T current_instruction);
+ void OptimizeLeftShiftBitAndSmiOp(Definition* bit_and_instr,
+ Definition* left_instr,
+ Definition* right_instr);
+
FlowGraph* flow_graph_;
DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer);
« 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