blob: b35bc3d7d3eeb868625b0aa1901de0d4264b3066 [file] [log] [blame]
Jean Christophe Beyler2469e602014-05-06 20:36:55 -07001/*
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 Chartier5bdab122015-01-26 18:30:19 -080017#include "pass_driver_me_post_opt.h"
18
Jean Christophe Beyler2469e602014-05-06 20:36:55 -070019#include "base/macros.h"
20#include "post_opt_passes.h"
Mathieu Chartier5bdab122015-01-26 18:30:19 -080021#include "pass_manager.h"
Jean Christophe Beyler2469e602014-05-06 20:36:55 -070022
23namespace art {
24
Mathieu Chartier5bdab122015-01-26 18:30:19 -080025void 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 Marko6a8946b2015-02-09 12:35:05 +000040 pass_manager->AddPass(new FindPhiNodeBlocksPass);
Mathieu Chartier5bdab122015-01-26 18:30:19 -080041 pass_manager->AddPass(new SSAConversion);
42 pass_manager->AddPass(new PhiNodeOperands);
43 pass_manager->AddPass(new PerformInitRegLocations);
Vladimir Markoc91df2d2015-04-23 09:29:21 +000044 pass_manager->AddPass(new TypeInferencePass);
Mathieu Chartier5bdab122015-01-26 18:30:19 -080045 pass_manager->AddPass(new FinishSSATransformation);
46}
Razvan A Lupusorubd25d4b2014-07-02 18:16:51 -070047
Jean Christophe Beyler2469e602014-05-06 20:36:55 -070048} // namespace art