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/Config/config.h" |
18 | #include "polly/Support/DumpFunctionPass.h" |
19 | #include "polly/Support/DumpModulePass.h" |
20 | #include "llvm/ADT/StringRef.h" |
21 | #include <cstdlib> |
22 | |
23 | namespace llvm { |
24 | class Pass; |
25 | class PassRegistry; |
26 | } // namespace llvm |
27 | |
28 | namespace polly { |
29 | llvm::Pass *createCodePreparationPass(); |
30 | llvm::Pass *createScopInlinerPass(); |
31 | llvm::Pass *createDeadCodeElimWrapperPass(); |
32 | llvm::Pass *createDependenceInfoPass(); |
33 | llvm::Pass *createDependenceInfoPrinterLegacyPass(llvm::raw_ostream &OS); |
34 | llvm::Pass *createDependenceInfoWrapperPassPass(); |
35 | llvm::Pass * |
36 | createDependenceInfoPrinterLegacyFunctionPass(llvm::raw_ostream &OS); |
37 | llvm::Pass *createDOTOnlyPrinterWrapperPass(); |
38 | llvm::Pass *createDOTOnlyViewerWrapperPass(); |
39 | llvm::Pass *createDOTPrinterWrapperPass(); |
40 | llvm::Pass *createDOTViewerWrapperPass(); |
41 | llvm::Pass *createJSONExporterPass(); |
42 | llvm::Pass *createJSONImporterPass(); |
43 | llvm::Pass *createJSONImporterPrinterLegacyPass(llvm::raw_ostream &OS); |
44 | llvm::Pass *createPollyCanonicalizePass(); |
45 | llvm::Pass *createPolyhedralInfoPass(); |
46 | llvm::Pass *createPolyhedralInfoPrinterLegacyPass(llvm::raw_ostream &OS); |
47 | llvm::Pass *createScopDetectionWrapperPassPass(); |
48 | llvm::Pass *createScopDetectionPrinterLegacyPass(llvm::raw_ostream &OS); |
49 | llvm::Pass *createScopInfoRegionPassPass(); |
50 | llvm::Pass *createScopInfoPrinterLegacyRegionPass(llvm::raw_ostream &OS); |
51 | llvm::Pass *createScopInfoWrapperPassPass(); |
52 | llvm::Pass *createScopInfoPrinterLegacyFunctionPass(llvm::raw_ostream &OS); |
53 | llvm::Pass *createIslAstInfoWrapperPassPass(); |
54 | llvm::Pass *createIslAstInfoPrinterLegacyPass(llvm::raw_ostream &OS); |
55 | llvm::Pass *createCodeGenerationPass(); |
56 | llvm::Pass *createIslScheduleOptimizerWrapperPass(); |
57 | llvm::Pass *createIslScheduleOptimizerPrinterLegacyPass(llvm::raw_ostream &OS); |
58 | llvm::Pass *createFlattenSchedulePass(); |
59 | llvm::Pass *createFlattenSchedulePrinterLegacyPass(llvm::raw_ostream &OS); |
60 | llvm::Pass *createForwardOpTreeWrapperPass(); |
61 | llvm::Pass *createForwardOpTreePrinterLegacyPass(llvm::raw_ostream &OS); |
62 | llvm::Pass *createDeLICMWrapperPass(); |
63 | llvm::Pass *createDeLICMPrinterLegacyPass(llvm::raw_ostream &OS); |
64 | llvm::Pass *createMaximalStaticExpansionPass(); |
65 | llvm::Pass *createSimplifyWrapperPass(int); |
66 | llvm::Pass *createSimplifyPrinterLegacyPass(llvm::raw_ostream &OS); |
67 | llvm::Pass *createPruneUnprofitableWrapperPass(); |
68 | |
69 | extern char &CodePreparationID; |
70 | } // namespace polly |
71 | |
72 | namespace { |
73 | struct PollyForcePassLinking { |
74 | PollyForcePassLinking() { |
75 | // We must reference the passes in such a way that compilers will not |
76 | // delete it all as dead code, even with whole program optimization, |
77 | // yet is effectively a NO-OP. As the compiler isn't smart enough |
78 | // to know that getenv() never returns -1, this will do the job. |
79 | if (std::getenv(name: "bar") != (char *)-1) |
80 | return; |
81 | |
82 | polly::createCodePreparationPass(); |
83 | polly::createDeadCodeElimWrapperPass(); |
84 | polly::createDependenceInfoPass(); |
85 | polly::createDependenceInfoPrinterLegacyPass(OS&: llvm::outs()); |
86 | polly::createDependenceInfoWrapperPassPass(); |
87 | polly::createDependenceInfoPrinterLegacyFunctionPass(OS&: llvm::outs()); |
88 | polly::createDOTOnlyPrinterWrapperPass(); |
89 | polly::createDOTOnlyViewerWrapperPass(); |
90 | polly::createDOTPrinterWrapperPass(); |
91 | polly::createDOTViewerWrapperPass(); |
92 | polly::createJSONExporterPass(); |
93 | polly::createJSONImporterPass(); |
94 | polly::createJSONImporterPrinterLegacyPass(OS&: llvm::outs()); |
95 | polly::createScopDetectionWrapperPassPass(); |
96 | polly::createScopDetectionPrinterLegacyPass(OS&: llvm::outs()); |
97 | polly::createScopInfoRegionPassPass(); |
98 | polly::createScopInfoPrinterLegacyRegionPass(OS&: llvm::outs()); |
99 | polly::createScopInfoWrapperPassPass(); |
100 | polly::createScopInfoPrinterLegacyFunctionPass(OS&: llvm::outs()); |
101 | polly::createPollyCanonicalizePass(); |
102 | polly::createPolyhedralInfoPass(); |
103 | polly::createPolyhedralInfoPrinterLegacyPass(OS&: llvm::outs()); |
104 | polly::createIslAstInfoWrapperPassPass(); |
105 | polly::createIslAstInfoPrinterLegacyPass(OS&: llvm::outs()); |
106 | polly::createCodeGenerationPass(); |
107 | polly::createIslScheduleOptimizerWrapperPass(); |
108 | polly::createIslScheduleOptimizerPrinterLegacyPass(OS&: llvm::outs()); |
109 | polly::createMaximalStaticExpansionPass(); |
110 | polly::createFlattenSchedulePass(); |
111 | polly::createFlattenSchedulePrinterLegacyPass(OS&: llvm::errs()); |
112 | polly::createForwardOpTreeWrapperPass(); |
113 | polly::createForwardOpTreePrinterLegacyPass(OS&: llvm::errs()); |
114 | polly::createDeLICMWrapperPass(); |
115 | polly::createDeLICMPrinterLegacyPass(OS&: llvm::outs()); |
116 | polly::createDumpModuleWrapperPass(Filename: "", IsSuffix: true); |
117 | polly::createDumpFunctionWrapperPass(Suffix: ""); |
118 | polly::createSimplifyWrapperPass(0); |
119 | polly::createSimplifyPrinterLegacyPass(OS&: llvm::outs()); |
120 | polly::createPruneUnprofitableWrapperPass(); |
121 | } |
122 | } PollyForcePassLinking; // Force link by creating a global definition. |
123 | } // namespace |
124 | |
125 | namespace llvm { |
126 | void initializeCodePreparationPass(llvm::PassRegistry &); |
127 | void initializeScopInlinerPass(llvm::PassRegistry &); |
128 | void initializeScopDetectionWrapperPassPass(llvm::PassRegistry &); |
129 | void initializeScopDetectionPrinterLegacyPassPass(llvm::PassRegistry &); |
130 | void initializeScopInfoRegionPassPass(PassRegistry &); |
131 | void initializeScopInfoPrinterLegacyRegionPassPass(llvm::PassRegistry &); |
132 | void initializeScopInfoWrapperPassPass(PassRegistry &); |
133 | void initializeScopInfoPrinterLegacyFunctionPassPass(PassRegistry &); |
134 | void initializeDeadCodeElimWrapperPassPass(llvm::PassRegistry &); |
135 | void initializeJSONExporterPass(llvm::PassRegistry &); |
136 | void initializeJSONImporterPass(llvm::PassRegistry &); |
137 | void initializeJSONImporterPrinterLegacyPassPass(llvm::PassRegistry &); |
138 | void initializeDependenceInfoPass(llvm::PassRegistry &); |
139 | void initializeDependenceInfoPrinterLegacyPassPass(llvm::PassRegistry &); |
140 | void initializeDependenceInfoWrapperPassPass(llvm::PassRegistry &); |
141 | void initializeDependenceInfoPrinterLegacyFunctionPassPass( |
142 | llvm::PassRegistry &); |
143 | void initializeIslAstInfoWrapperPassPass(llvm::PassRegistry &); |
144 | void initializeIslAstInfoPrinterLegacyPassPass(llvm::PassRegistry &); |
145 | void initializeCodeGenerationPass(llvm::PassRegistry &); |
146 | void initializeIslScheduleOptimizerWrapperPassPass(llvm::PassRegistry &); |
147 | void initializeIslScheduleOptimizerPrinterLegacyPassPass(llvm::PassRegistry &); |
148 | void initializeMaximalStaticExpanderWrapperPassPass(llvm::PassRegistry &); |
149 | void initializePollyCanonicalizePass(llvm::PassRegistry &); |
150 | void initializeFlattenSchedulePass(llvm::PassRegistry &); |
151 | void initializeFlattenSchedulePrinterLegacyPassPass(llvm::PassRegistry &); |
152 | void initializeForwardOpTreeWrapperPassPass(llvm::PassRegistry &); |
153 | void initializeForwardOpTreePrinterLegacyPassPass(PassRegistry &); |
154 | void initializeDeLICMWrapperPassPass(llvm::PassRegistry &); |
155 | void initializeDeLICMPrinterLegacyPassPass(llvm::PassRegistry &); |
156 | void initializeSimplifyWrapperPassPass(llvm::PassRegistry &); |
157 | void initializeSimplifyPrinterLegacyPassPass(llvm::PassRegistry &); |
158 | void initializePruneUnprofitableWrapperPassPass(llvm::PassRegistry &); |
159 | void initializePolyhedralInfoPass(llvm::PassRegistry &); |
160 | void initializePolyhedralInfoPrinterLegacyPassPass(llvm::PassRegistry &); |
161 | } // namespace llvm |
162 | |
163 | #endif |
164 |