OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 DECLARE_FLAG(bool, trace_type_check_elimination); | 25 DECLARE_FLAG(bool, trace_type_check_elimination); |
26 DEFINE_FLAG(bool, use_cha, true, "Use class hierarchy analysis."); | 26 DEFINE_FLAG(bool, use_cha, true, "Use class hierarchy analysis."); |
27 DEFINE_FLAG(bool, load_cse, true, "Use redundant load elimination."); | 27 DEFINE_FLAG(bool, load_cse, true, "Use redundant load elimination."); |
28 DEFINE_FLAG(bool, trace_range_analysis, false, "Trace range analysis progress"); | 28 DEFINE_FLAG(bool, trace_range_analysis, false, "Trace range analysis progress"); |
29 DEFINE_FLAG(bool, trace_constant_propagation, false, | 29 DEFINE_FLAG(bool, trace_constant_propagation, false, |
30 "Print constant propagation and useless code elimination."); | 30 "Print constant propagation and useless code elimination."); |
31 DEFINE_FLAG(bool, array_bounds_check_elimination, true, | 31 DEFINE_FLAG(bool, array_bounds_check_elimination, true, |
32 "Eliminate redundant bounds checks."); | 32 "Eliminate redundant bounds checks."); |
33 DEFINE_FLAG(int, max_polymorphic_checks, 4, | 33 DEFINE_FLAG(int, max_polymorphic_checks, 4, |
34 "Maximum number of polymorphic check, otherwise it is megamorphic."); | 34 "Maximum number of polymorphic check, otherwise it is megamorphic."); |
35 DEFINE_FLAG(bool, remove_redundant_phis, false, | 35 DEFINE_FLAG(bool, remove_redundant_phis, true, "Remove redundant phis."); |
36 "Remove redundant phis (disabled as causes incorrect code)."); | |
37 | 36 |
38 | 37 |
39 void FlowGraphOptimizer::ApplyICData() { | 38 void FlowGraphOptimizer::ApplyICData() { |
40 VisitBlocks(); | 39 VisitBlocks(); |
41 } | 40 } |
42 | 41 |
43 | 42 |
44 // Attempts to convert an instance call (IC call) using propagated class-ids, | 43 // Attempts to convert an instance call (IC call) using propagated class-ids, |
45 // e.g., receiver class id. | 44 // e.g., receiver class id. |
46 void FlowGraphOptimizer::ApplyClassIds() { | 45 void FlowGraphOptimizer::ApplyClassIds() { |
(...skipping 3686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3733 | 3732 |
3734 if (FLAG_trace_constant_propagation) { | 3733 if (FLAG_trace_constant_propagation) { |
3735 OS::Print("\n==== After constant propagation ====\n"); | 3734 OS::Print("\n==== After constant propagation ====\n"); |
3736 FlowGraphPrinter printer(*graph_); | 3735 FlowGraphPrinter printer(*graph_); |
3737 printer.PrintBlocks(); | 3736 printer.PrintBlocks(); |
3738 } | 3737 } |
3739 } | 3738 } |
3740 | 3739 |
3741 | 3740 |
3742 } // namespace dart | 3741 } // namespace dart |
OLD | NEW |