Jean Christophe Beyler | 2469e60 | 2014-05-06 20:36:55 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 17 | #include "pass_driver_me_post_opt.h" |
| 18 | |
Jean Christophe Beyler | 2469e60 | 2014-05-06 20:36:55 -0700 | [diff] [blame] | 19 | #include "base/macros.h" |
| 20 | #include "post_opt_passes.h" |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 21 | #include "pass_manager.h" |
Jean Christophe Beyler | 2469e60 | 2014-05-06 20:36:55 -0700 | [diff] [blame] | 22 | |
| 23 | namespace art { |
| 24 | |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 25 | void PassDriverMEPostOpt::SetupPasses(PassManager* pass_manager) { |
| 26 | /* |
| 27 | * Create the pass list. These passes are immutable and are shared across the threads. |
| 28 | * |
| 29 | * Advantage is that there will be no race conditions here. |
| 30 | * Disadvantage is the passes can't change their internal states depending on CompilationUnit: |
| 31 | * - This is not yet an issue: no current pass would require it. |
| 32 | */ |
| 33 | // The initial list of passes to be used by the PassDriveMEPostOpt. |
| 34 | pass_manager->AddPass(new DFSOrders); |
| 35 | pass_manager->AddPass(new BuildDomination); |
| 36 | pass_manager->AddPass(new TopologicalSortOrders); |
| 37 | pass_manager->AddPass(new InitializeSSATransformation); |
| 38 | pass_manager->AddPass(new ClearPhiInstructions); |
| 39 | pass_manager->AddPass(new DefBlockMatrix); |
Vladimir Marko | 6a8946b | 2015-02-09 12:35:05 +0000 | [diff] [blame] | 40 | pass_manager->AddPass(new FindPhiNodeBlocksPass); |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 41 | pass_manager->AddPass(new SSAConversion); |
| 42 | pass_manager->AddPass(new PhiNodeOperands); |
| 43 | pass_manager->AddPass(new PerformInitRegLocations); |
Vladimir Marko | c91df2d | 2015-04-23 09:29:21 +0000 | [diff] [blame] | 44 | pass_manager->AddPass(new TypeInferencePass); |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 45 | pass_manager->AddPass(new FinishSSATransformation); |
| 46 | } |
Razvan A Lupusoru | bd25d4b | 2014-07-02 18:16:51 -0700 | [diff] [blame] | 47 | |
Jean Christophe Beyler | 2469e60 | 2014-05-06 20:36:55 -0700 | [diff] [blame] | 48 | } // namespace art |