Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14 | pmbaty | 1 | //===- polly/LinkAllPasses.h ----------- Reference All Passes ---*- C++ -*-===// |
2 | // |
||
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
||
4 | // See https://llvm.org/LICENSE.txt for license information. |
||
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
||
6 | // |
||
7 | //===----------------------------------------------------------------------===// |
||
8 | // |
||
9 | // This header file pulls in all transformation and analysis passes for tools |
||
10 | // like opt and bugpoint that need this functionality. |
||
11 | // |
||
12 | //===----------------------------------------------------------------------===// |
||
13 | |||
14 | #ifndef POLLY_LINKALLPASSES_H |
||
15 | #define POLLY_LINKALLPASSES_H |
||
16 | |||
17 | #include "polly/CodeGen/PPCGCodeGeneration.h" |
||
18 | #include "polly/Config/config.h" |
||
19 | #include "polly/Support/DumpFunctionPass.h" |
||
20 | #include "polly/Support/DumpModulePass.h" |
||
21 | #include "llvm/ADT/StringRef.h" |
||
22 | #include <cstdlib> |
||
23 | |||
24 | namespace llvm { |
||
25 | class Pass; |
||
26 | class PassRegistry; |
||
27 | } // namespace llvm |
||
28 | |||
29 | namespace polly { |
||
30 | llvm::Pass *createCodePreparationPass(); |
||
31 | llvm::Pass *createScopInlinerPass(); |
||
32 | llvm::Pass *createDeadCodeElimWrapperPass(); |
||
33 | llvm::Pass *createDependenceInfoPass(); |
||
34 | llvm::Pass *createDependenceInfoPrinterLegacyPass(llvm::raw_ostream &OS); |
||
35 | llvm::Pass *createDependenceInfoWrapperPassPass(); |
||
36 | llvm::Pass * |
||
37 | createDependenceInfoPrinterLegacyFunctionPass(llvm::raw_ostream &OS); |
||
38 | llvm::Pass *createDOTOnlyPrinterWrapperPass(); |
||
39 | llvm::Pass *createDOTOnlyViewerWrapperPass(); |
||
40 | llvm::Pass *createDOTPrinterWrapperPass(); |
||
41 | llvm::Pass *createDOTViewerWrapperPass(); |
||
42 | llvm::Pass *createJSONExporterPass(); |
||
43 | llvm::Pass *createJSONImporterPass(); |
||
44 | llvm::Pass *createJSONImporterPrinterLegacyPass(llvm::raw_ostream &OS); |
||
45 | llvm::Pass *createPollyCanonicalizePass(); |
||
46 | llvm::Pass *createPolyhedralInfoPass(); |
||
47 | llvm::Pass *createPolyhedralInfoPrinterLegacyPass(llvm::raw_ostream &OS); |
||
48 | llvm::Pass *createScopDetectionWrapperPassPass(); |
||
49 | llvm::Pass *createScopDetectionPrinterLegacyPass(llvm::raw_ostream &OS); |
||
50 | llvm::Pass *createScopInfoRegionPassPass(); |
||
51 | llvm::Pass *createScopInfoPrinterLegacyRegionPass(llvm::raw_ostream &OS); |
||
52 | llvm::Pass *createScopInfoWrapperPassPass(); |
||
53 | llvm::Pass *createScopInfoPrinterLegacyFunctionPass(llvm::raw_ostream &OS); |
||
54 | llvm::Pass *createIslAstInfoWrapperPassPass(); |
||
55 | llvm::Pass *createIslAstInfoPrinterLegacyPass(llvm::raw_ostream &OS); |
||
56 | llvm::Pass *createCodeGenerationPass(); |
||
57 | #ifdef GPU_CODEGEN |
||
58 | llvm::Pass *createPPCGCodeGenerationPass(GPUArch Arch = GPUArch::NVPTX64, |
||
59 | GPURuntime Runtime = GPURuntime::CUDA); |
||
60 | |||
61 | llvm::Pass * |
||
62 | createManagedMemoryRewritePassPass(GPUArch Arch = GPUArch::NVPTX64, |
||
63 | GPURuntime Runtime = GPURuntime::CUDA); |
||
64 | #endif |
||
65 | llvm::Pass *createIslScheduleOptimizerWrapperPass(); |
||
66 | llvm::Pass *createIslScheduleOptimizerPrinterLegacyPass(llvm::raw_ostream &OS); |
||
67 | llvm::Pass *createFlattenSchedulePass(); |
||
68 | llvm::Pass *createFlattenSchedulePrinterLegacyPass(llvm::raw_ostream &OS); |
||
69 | llvm::Pass *createForwardOpTreeWrapperPass(); |
||
70 | llvm::Pass *createForwardOpTreePrinterLegacyPass(llvm::raw_ostream &OS); |
||
71 | llvm::Pass *createDeLICMWrapperPass(); |
||
72 | llvm::Pass *createDeLICMPrinterLegacyPass(llvm::raw_ostream &OS); |
||
73 | llvm::Pass *createMaximalStaticExpansionPass(); |
||
74 | llvm::Pass *createSimplifyWrapperPass(int); |
||
75 | llvm::Pass *createSimplifyPrinterLegacyPass(llvm::raw_ostream &OS); |
||
76 | llvm::Pass *createPruneUnprofitableWrapperPass(); |
||
77 | |||
78 | extern char &CodePreparationID; |
||
79 | } // namespace polly |
||
80 | |||
81 | namespace { |
||
82 | struct PollyForcePassLinking { |
||
83 | PollyForcePassLinking() { |
||
84 | // We must reference the passes in such a way that compilers will not |
||
85 | // delete it all as dead code, even with whole program optimization, |
||
86 | // yet is effectively a NO-OP. As the compiler isn't smart enough |
||
87 | // to know that getenv() never returns -1, this will do the job. |
||
88 | if (std::getenv("bar") != (char *)-1) |
||
89 | return; |
||
90 | |||
91 | polly::createCodePreparationPass(); |
||
92 | polly::createDeadCodeElimWrapperPass(); |
||
93 | polly::createDependenceInfoPass(); |
||
94 | polly::createDependenceInfoPrinterLegacyPass(llvm::outs()); |
||
95 | polly::createDependenceInfoWrapperPassPass(); |
||
96 | polly::createDependenceInfoPrinterLegacyFunctionPass(llvm::outs()); |
||
97 | polly::createDOTOnlyPrinterWrapperPass(); |
||
98 | polly::createDOTOnlyViewerWrapperPass(); |
||
99 | polly::createDOTPrinterWrapperPass(); |
||
100 | polly::createDOTViewerWrapperPass(); |
||
101 | polly::createJSONExporterPass(); |
||
102 | polly::createJSONImporterPass(); |
||
103 | polly::createJSONImporterPrinterLegacyPass(llvm::outs()); |
||
104 | polly::createScopDetectionWrapperPassPass(); |
||
105 | polly::createScopDetectionPrinterLegacyPass(llvm::outs()); |
||
106 | polly::createScopInfoRegionPassPass(); |
||
107 | polly::createScopInfoPrinterLegacyRegionPass(llvm::outs()); |
||
108 | polly::createScopInfoWrapperPassPass(); |
||
109 | polly::createScopInfoPrinterLegacyFunctionPass(llvm::outs()); |
||
110 | polly::createPollyCanonicalizePass(); |
||
111 | polly::createPolyhedralInfoPass(); |
||
112 | polly::createPolyhedralInfoPrinterLegacyPass(llvm::outs()); |
||
113 | polly::createIslAstInfoWrapperPassPass(); |
||
114 | polly::createIslAstInfoPrinterLegacyPass(llvm::outs()); |
||
115 | polly::createCodeGenerationPass(); |
||
116 | #ifdef GPU_CODEGEN |
||
117 | polly::createPPCGCodeGenerationPass(); |
||
118 | polly::createManagedMemoryRewritePassPass(); |
||
119 | #endif |
||
120 | polly::createIslScheduleOptimizerWrapperPass(); |
||
121 | polly::createIslScheduleOptimizerPrinterLegacyPass(llvm::outs()); |
||
122 | polly::createMaximalStaticExpansionPass(); |
||
123 | polly::createFlattenSchedulePass(); |
||
124 | polly::createFlattenSchedulePrinterLegacyPass(llvm::errs()); |
||
125 | polly::createForwardOpTreeWrapperPass(); |
||
126 | polly::createForwardOpTreePrinterLegacyPass(llvm::errs()); |
||
127 | polly::createDeLICMWrapperPass(); |
||
128 | polly::createDeLICMPrinterLegacyPass(llvm::outs()); |
||
129 | polly::createDumpModuleWrapperPass("", true); |
||
130 | polly::createDumpFunctionWrapperPass(""); |
||
131 | polly::createSimplifyWrapperPass(0); |
||
132 | polly::createSimplifyPrinterLegacyPass(llvm::outs()); |
||
133 | polly::createPruneUnprofitableWrapperPass(); |
||
134 | } |
||
135 | } PollyForcePassLinking; // Force link by creating a global definition. |
||
136 | } // namespace |
||
137 | |||
138 | namespace llvm { |
||
139 | void initializeCodePreparationPass(llvm::PassRegistry &); |
||
140 | void initializeScopInlinerPass(llvm::PassRegistry &); |
||
141 | void initializeScopDetectionWrapperPassPass(llvm::PassRegistry &); |
||
142 | void initializeScopDetectionPrinterLegacyPassPass(llvm::PassRegistry &); |
||
143 | void initializeScopInfoRegionPassPass(PassRegistry &); |
||
144 | void initializeScopInfoPrinterLegacyRegionPassPass(llvm::PassRegistry &); |
||
145 | void initializeScopInfoWrapperPassPass(PassRegistry &); |
||
146 | void initializeScopInfoPrinterLegacyFunctionPassPass(PassRegistry &); |
||
147 | void initializeDeadCodeElimWrapperPassPass(llvm::PassRegistry &); |
||
148 | void initializeJSONExporterPass(llvm::PassRegistry &); |
||
149 | void initializeJSONImporterPass(llvm::PassRegistry &); |
||
150 | void initializeJSONImporterPrinterLegacyPassPass(llvm::PassRegistry &); |
||
151 | void initializeDependenceInfoPass(llvm::PassRegistry &); |
||
152 | void initializeDependenceInfoPrinterLegacyPassPass(llvm::PassRegistry &); |
||
153 | void initializeDependenceInfoWrapperPassPass(llvm::PassRegistry &); |
||
154 | void initializeDependenceInfoPrinterLegacyFunctionPassPass( |
||
155 | llvm::PassRegistry &); |
||
156 | void initializeIslAstInfoWrapperPassPass(llvm::PassRegistry &); |
||
157 | void initializeIslAstInfoPrinterLegacyPassPass(llvm::PassRegistry &); |
||
158 | void initializeCodeGenerationPass(llvm::PassRegistry &); |
||
159 | #ifdef GPU_CODEGEN |
||
160 | void initializePPCGCodeGenerationPass(llvm::PassRegistry &); |
||
161 | void initializeManagedMemoryRewritePassPass(llvm::PassRegistry &); |
||
162 | #endif |
||
163 | void initializeIslScheduleOptimizerWrapperPassPass(llvm::PassRegistry &); |
||
164 | void initializeIslScheduleOptimizerPrinterLegacyPassPass(llvm::PassRegistry &); |
||
165 | void initializeMaximalStaticExpanderWrapperPassPass(llvm::PassRegistry &); |
||
166 | void initializePollyCanonicalizePass(llvm::PassRegistry &); |
||
167 | void initializeFlattenSchedulePass(llvm::PassRegistry &); |
||
168 | void initializeFlattenSchedulePrinterLegacyPassPass(llvm::PassRegistry &); |
||
169 | void initializeForwardOpTreeWrapperPassPass(llvm::PassRegistry &); |
||
170 | void initializeForwardOpTreePrinterLegacyPassPass(PassRegistry &); |
||
171 | void initializeDeLICMWrapperPassPass(llvm::PassRegistry &); |
||
172 | void initializeDeLICMPrinterLegacyPassPass(llvm::PassRegistry &); |
||
173 | void initializeSimplifyWrapperPassPass(llvm::PassRegistry &); |
||
174 | void initializeSimplifyPrinterLegacyPassPass(llvm::PassRegistry &); |
||
175 | void initializePruneUnprofitableWrapperPassPass(llvm::PassRegistry &); |
||
176 | void initializePolyhedralInfoPass(llvm::PassRegistry &); |
||
177 | void initializePolyhedralInfoPrinterLegacyPassPass(llvm::PassRegistry &); |
||
178 | } // namespace llvm |
||
179 | |||
180 | #endif |