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
23namespace llvm {
24class Pass;
25class PassRegistry;
26} // namespace llvm
27
28namespace polly {
29llvm::Pass *createCodePreparationPass();
30llvm::Pass *createScopInlinerPass();
31llvm::Pass *createDeadCodeElimWrapperPass();
32llvm::Pass *createDependenceInfoPass();
33llvm::Pass *createDependenceInfoPrinterLegacyPass(llvm::raw_ostream &OS);
34llvm::Pass *createDependenceInfoWrapperPassPass();
35llvm::Pass *
36createDependenceInfoPrinterLegacyFunctionPass(llvm::raw_ostream &OS);
37llvm::Pass *createDOTOnlyPrinterWrapperPass();
38llvm::Pass *createDOTOnlyViewerWrapperPass();
39llvm::Pass *createDOTPrinterWrapperPass();
40llvm::Pass *createDOTViewerWrapperPass();
41llvm::Pass *createJSONExporterPass();
42llvm::Pass *createJSONImporterPass();
43llvm::Pass *createJSONImporterPrinterLegacyPass(llvm::raw_ostream &OS);
44llvm::Pass *createPollyCanonicalizePass();
45llvm::Pass *createPolyhedralInfoPass();
46llvm::Pass *createPolyhedralInfoPrinterLegacyPass(llvm::raw_ostream &OS);
47llvm::Pass *createScopDetectionWrapperPassPass();
48llvm::Pass *createScopDetectionPrinterLegacyPass(llvm::raw_ostream &OS);
49llvm::Pass *createScopInfoRegionPassPass();
50llvm::Pass *createScopInfoPrinterLegacyRegionPass(llvm::raw_ostream &OS);
51llvm::Pass *createScopInfoWrapperPassPass();
52llvm::Pass *createScopInfoPrinterLegacyFunctionPass(llvm::raw_ostream &OS);
53llvm::Pass *createIslAstInfoWrapperPassPass();
54llvm::Pass *createIslAstInfoPrinterLegacyPass(llvm::raw_ostream &OS);
55llvm::Pass *createCodeGenerationPass();
56llvm::Pass *createIslScheduleOptimizerWrapperPass();
57llvm::Pass *createIslScheduleOptimizerPrinterLegacyPass(llvm::raw_ostream &OS);
58llvm::Pass *createFlattenSchedulePass();
59llvm::Pass *createFlattenSchedulePrinterLegacyPass(llvm::raw_ostream &OS);
60llvm::Pass *createForwardOpTreeWrapperPass();
61llvm::Pass *createForwardOpTreePrinterLegacyPass(llvm::raw_ostream &OS);
62llvm::Pass *createDeLICMWrapperPass();
63llvm::Pass *createDeLICMPrinterLegacyPass(llvm::raw_ostream &OS);
64llvm::Pass *createMaximalStaticExpansionPass();
65llvm::Pass *createSimplifyWrapperPass(int);
66llvm::Pass *createSimplifyPrinterLegacyPass(llvm::raw_ostream &OS);
67llvm::Pass *createPruneUnprofitableWrapperPass();
68
69extern char &CodePreparationID;
70} // namespace polly
71
72namespace {
73struct 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
125namespace llvm {
126void initializeCodePreparationPass(llvm::PassRegistry &);
127void initializeScopInlinerPass(llvm::PassRegistry &);
128void initializeScopDetectionWrapperPassPass(llvm::PassRegistry &);
129void initializeScopDetectionPrinterLegacyPassPass(llvm::PassRegistry &);
130void initializeScopInfoRegionPassPass(PassRegistry &);
131void initializeScopInfoPrinterLegacyRegionPassPass(llvm::PassRegistry &);
132void initializeScopInfoWrapperPassPass(PassRegistry &);
133void initializeScopInfoPrinterLegacyFunctionPassPass(PassRegistry &);
134void initializeDeadCodeElimWrapperPassPass(llvm::PassRegistry &);
135void initializeJSONExporterPass(llvm::PassRegistry &);
136void initializeJSONImporterPass(llvm::PassRegistry &);
137void initializeJSONImporterPrinterLegacyPassPass(llvm::PassRegistry &);
138void initializeDependenceInfoPass(llvm::PassRegistry &);
139void initializeDependenceInfoPrinterLegacyPassPass(llvm::PassRegistry &);
140void initializeDependenceInfoWrapperPassPass(llvm::PassRegistry &);
141void initializeDependenceInfoPrinterLegacyFunctionPassPass(
142 llvm::PassRegistry &);
143void initializeIslAstInfoWrapperPassPass(llvm::PassRegistry &);
144void initializeIslAstInfoPrinterLegacyPassPass(llvm::PassRegistry &);
145void initializeCodeGenerationPass(llvm::PassRegistry &);
146void initializeIslScheduleOptimizerWrapperPassPass(llvm::PassRegistry &);
147void initializeIslScheduleOptimizerPrinterLegacyPassPass(llvm::PassRegistry &);
148void initializeMaximalStaticExpanderWrapperPassPass(llvm::PassRegistry &);
149void initializePollyCanonicalizePass(llvm::PassRegistry &);
150void initializeFlattenSchedulePass(llvm::PassRegistry &);
151void initializeFlattenSchedulePrinterLegacyPassPass(llvm::PassRegistry &);
152void initializeForwardOpTreeWrapperPassPass(llvm::PassRegistry &);
153void initializeForwardOpTreePrinterLegacyPassPass(PassRegistry &);
154void initializeDeLICMWrapperPassPass(llvm::PassRegistry &);
155void initializeDeLICMPrinterLegacyPassPass(llvm::PassRegistry &);
156void initializeSimplifyWrapperPassPass(llvm::PassRegistry &);
157void initializeSimplifyPrinterLegacyPassPass(llvm::PassRegistry &);
158void initializePruneUnprofitableWrapperPassPass(llvm::PassRegistry &);
159void initializePolyhedralInfoPass(llvm::PassRegistry &);
160void initializePolyhedralInfoPrinterLegacyPassPass(llvm::PassRegistry &);
161} // namespace llvm
162
163#endif
164

source code of polly/include/polly/LinkAllPasses.h