OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/precompiler.h" | 5 #include "vm/precompiler.h" |
6 | 6 |
7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
10 #include "vm/branch_optimizer.h" | 10 #include "vm/branch_optimizer.h" |
(...skipping 3198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3209 flow_graph->Canonicalize(); | 3209 flow_graph->Canonicalize(); |
3210 } | 3210 } |
3211 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 3211 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
3212 } | 3212 } |
3213 } | 3213 } |
3214 | 3214 |
3215 // Run loop-invariant code motion right after load elimination since | 3215 // Run loop-invariant code motion right after load elimination since |
3216 // it depends on the numbering of loads from the previous | 3216 // it depends on the numbering of loads from the previous |
3217 // load-elimination. | 3217 // load-elimination. |
3218 if (FLAG_loop_invariant_code_motion) { | 3218 if (FLAG_loop_invariant_code_motion) { |
| 3219 flow_graph->RenameUsesDominatedByRedefinitions(); |
| 3220 DEBUG_ASSERT(flow_graph->VerifyRedefinitions()); |
3219 LICM licm(flow_graph); | 3221 LICM licm(flow_graph); |
3220 licm.Optimize(); | 3222 licm.Optimize(); |
3221 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 3223 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
3222 } | 3224 } |
3223 flow_graph->RemoveRedefinitions(); | 3225 flow_graph->RemoveRedefinitions(); |
3224 } | 3226 } |
3225 | 3227 |
3226 // Optimize (a << b) & c patterns, merge operations. | 3228 // Optimize (a << b) & c patterns, merge operations. |
3227 // Run after CSE in order to have more opportunity to merge | 3229 // Run after CSE in order to have more opportunity to merge |
3228 // instructions that have same inputs. | 3230 // instructions that have same inputs. |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3552 | 3554 |
3553 ASSERT(FLAG_precompiled_mode); | 3555 ASSERT(FLAG_precompiled_mode); |
3554 const bool optimized = function.IsOptimizable(); // False for natives. | 3556 const bool optimized = function.IsOptimizable(); // False for natives. |
3555 DartPrecompilationPipeline pipeline(zone, field_type_map); | 3557 DartPrecompilationPipeline pipeline(zone, field_type_map); |
3556 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); | 3558 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); |
3557 } | 3559 } |
3558 | 3560 |
3559 #endif // DART_PRECOMPILER | 3561 #endif // DART_PRECOMPILER |
3560 | 3562 |
3561 } // namespace dart | 3563 } // namespace dart |
OLD | NEW |