| Index: runtime/vm/compiler.cc
|
| diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
|
| index df20d4d2653426c4e3b09e81352abb3cd95133ff..d23b879a18783126b8e768e7262050ce41fd730c 100644
|
| --- a/runtime/vm/compiler.cc
|
| +++ b/runtime/vm/compiler.cc
|
| @@ -35,6 +35,8 @@ DEFINE_FLAG(bool, disassemble, false, "Disassemble dart code.");
|
| DEFINE_FLAG(bool, disassemble_optimized, false, "Disassemble optimized code.");
|
| DEFINE_FLAG(bool, trace_bailout, false, "Print bailout from ssa compiler.");
|
| DEFINE_FLAG(bool, trace_compiler, false, "Trace compiler operations.");
|
| +DEFINE_FLAG(bool, cp, true,
|
| + "Do conditional constant propagation/unreachable code elimination.");
|
| DEFINE_FLAG(bool, cse, true, "Do common subexpression elimination.");
|
| DEFINE_FLAG(bool, licm, true, "Do loop invariant code motion.");
|
| DEFINE_FLAG(int, deoptimization_counter_threshold, 5,
|
| @@ -213,13 +215,10 @@ static bool CompileParsedFunctionHelper(const ParsedFunction& parsed_function,
|
| flow_graph->ComputeUseLists();
|
| optimizer.SelectRepresentations();
|
|
|
| - if (FLAG_cse) {
|
| - flow_graph->ComputeUseLists();
|
| - DominatorBasedCSE::Optimize(flow_graph);
|
| - }
|
| - if (FLAG_licm) {
|
| - LICM::Optimize(flow_graph);
|
| - }
|
| + if (FLAG_cp || FLAG_cse) flow_graph->ComputeUseLists();
|
| + if (FLAG_cp) ConstantPropagator::Optimize(flow_graph);
|
| + if (FLAG_cse) DominatorBasedCSE::Optimize(flow_graph);
|
| + if (FLAG_licm) LICM::Optimize(flow_graph);
|
|
|
| // Perform register allocation on the SSA graph.
|
| FlowGraphAllocator allocator(*flow_graph);
|
|
|