1//===- llvm/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 LLVM_LINKALLPASSES_H
15#define LLVM_LINKALLPASSES_H
16
17#include "llvm/ADT/Statistic.h"
18#include "llvm/Analysis/AliasAnalysisEvaluator.h"
19#include "llvm/Analysis/AliasSetTracker.h"
20#include "llvm/Analysis/BasicAliasAnalysis.h"
21#include "llvm/Analysis/CFLAndersAliasAnalysis.h"
22#include "llvm/Analysis/CFLSteensAliasAnalysis.h"
23#include "llvm/Analysis/CallPrinter.h"
24#include "llvm/Analysis/DomPrinter.h"
25#include "llvm/Analysis/GlobalsModRef.h"
26#include "llvm/Analysis/IntervalPartition.h"
27#include "llvm/Analysis/Lint.h"
28#include "llvm/Analysis/Passes.h"
29#include "llvm/Analysis/PostDominators.h"
30#include "llvm/Analysis/RegionPass.h"
31#include "llvm/Analysis/RegionPrinter.h"
32#include "llvm/Analysis/ScalarEvolution.h"
33#include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"
34#include "llvm/Analysis/ScopedNoAliasAA.h"
35#include "llvm/Analysis/TargetLibraryInfo.h"
36#include "llvm/Analysis/TypeBasedAliasAnalysis.h"
37#include "llvm/CodeGen/Passes.h"
38#include "llvm/IR/Function.h"
39#include "llvm/IR/IRPrintingPasses.h"
40#include "llvm/Support/Valgrind.h"
41#include "llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h"
42#include "llvm/Transforms/IPO.h"
43#include "llvm/Transforms/IPO/AlwaysInliner.h"
44#include "llvm/Transforms/IPO/Attributor.h"
45#include "llvm/Transforms/IPO/FunctionAttrs.h"
46#include "llvm/Transforms/InstCombine/InstCombine.h"
47#include "llvm/Transforms/Instrumentation.h"
48#include "llvm/Transforms/Instrumentation/BoundsChecking.h"
49#include "llvm/Transforms/ObjCARC.h"
50#include "llvm/Transforms/Scalar.h"
51#include "llvm/Transforms/Scalar/GVN.h"
52#include "llvm/Transforms/Scalar/InstSimplifyPass.h"
53#include "llvm/Transforms/Scalar/Scalarizer.h"
54#include "llvm/Transforms/Utils.h"
55#include "llvm/Transforms/Utils/SymbolRewriter.h"
56#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
57#include "llvm/Transforms/Vectorize.h"
58#include <cstdlib>
59
60namespace {
61 struct ForcePassLinking {
62 ForcePassLinking() {
63 // We must reference the passes in such a way that compilers will not
64 // delete it all as dead code, even with whole program optimization,
65 // yet is effectively a NO-OP. As the compiler isn't smart enough
66 // to know that getenv() never returns -1, this will do the job.
67 // This is so that globals in the translation units where these functions
68 // are defined are forced to be initialized, populating various
69 // registries.
70 if (std::getenv("bar") != (char*) -1)
71 return;
72
73 (void) llvm::createAAEvalPass();
74 (void) llvm::createAggressiveDCEPass();
75 (void) llvm::createAggressiveInstCombinerPass();
76 (void) llvm::createBitTrackingDCEPass();
77 (void)llvm::createOpenMPOptCGSCCLegacyPass();
78 (void) llvm::createAlignmentFromAssumptionsPass();
79 (void) llvm::createBasicAAWrapperPass();
80 (void) llvm::createSCEVAAWrapperPass();
81 (void) llvm::createTypeBasedAAWrapperPass();
82 (void) llvm::createScopedNoAliasAAWrapperPass();
83 (void) llvm::createBoundsCheckingLegacyPass();
84 (void) llvm::createBreakCriticalEdgesPass();
85 (void) llvm::createCallGraphDOTPrinterPass();
86 (void) llvm::createCallGraphViewerPass();
87 (void) llvm::createCFGSimplificationPass();
88 (void) llvm::createCFLAndersAAWrapperPass();
89 (void) llvm::createCFLSteensAAWrapperPass();
90 (void) llvm::createStructurizeCFGPass();
91 (void) llvm::createLibCallsShrinkWrapPass();
92 (void) llvm::createCalledValuePropagationPass();
93 (void) llvm::createConstantMergePass();
94 (void) llvm::createCostModelAnalysisPass();
95 (void) llvm::createDeadArgEliminationPass();
96 (void) llvm::createDeadCodeEliminationPass();
97 (void) llvm::createDeadStoreEliminationPass();
98 (void) llvm::createDependenceAnalysisWrapperPass();
99 (void) llvm::createDomOnlyPrinterWrapperPassPass();
100 (void) llvm::createDomPrinterWrapperPassPass();
101 (void) llvm::createDomOnlyViewerWrapperPassPass();
102 (void) llvm::createDomViewerWrapperPassPass();
103 (void) llvm::createFunctionInliningPass();
104 (void) llvm::createAlwaysInlinerLegacyPass();
105 (void) llvm::createGlobalDCEPass();
106 (void) llvm::createGlobalOptimizerPass();
107 (void) llvm::createGlobalsAAWrapperPass();
108 (void) llvm::createGuardWideningPass();
109 (void) llvm::createLoopGuardWideningPass();
110 (void) llvm::createIPSCCPPass();
111 (void) llvm::createInductiveRangeCheckEliminationPass();
112 (void) llvm::createIndVarSimplifyPass();
113 (void) llvm::createInstSimplifyLegacyPass();
114 (void) llvm::createInstructionCombiningPass();
115 (void) llvm::createInternalizePass();
116 (void) llvm::createJMCInstrumenterPass();
117 (void) llvm::createLCSSAPass();
118 (void) llvm::createLegacyDivergenceAnalysisPass();
119 (void) llvm::createLICMPass();
120 (void) llvm::createLoopSinkPass();
121 (void) llvm::createLazyValueInfoPass();
122 (void) llvm::createLoopExtractorPass();
123 (void) llvm::createLoopInterchangePass();
124 (void) llvm::createLoopFlattenPass();
125 (void) llvm::createLoopPredicationPass();
126 (void) llvm::createLoopSimplifyPass();
127 (void) llvm::createLoopSimplifyCFGPass();
128 (void) llvm::createLoopStrengthReducePass();
129 (void) llvm::createLoopRerollPass();
130 (void) llvm::createLoopUnrollPass();
131 (void) llvm::createLoopUnrollAndJamPass();
132 (void) llvm::createLoopVersioningLICMPass();
133 (void) llvm::createLoopIdiomPass();
134 (void) llvm::createLoopRotatePass();
135 (void) llvm::createLowerConstantIntrinsicsPass();
136 (void) llvm::createLowerExpectIntrinsicPass();
137 (void) llvm::createLowerGlobalDtorsLegacyPass();
138 (void) llvm::createLowerInvokePass();
139 (void) llvm::createLowerSwitchPass();
140 (void) llvm::createNaryReassociatePass();
141 (void) llvm::createObjCARCAAWrapperPass();
142 (void) llvm::createObjCARCAPElimPass();
143 (void) llvm::createObjCARCExpandPass();
144 (void) llvm::createObjCARCContractPass();
145 (void) llvm::createObjCARCOptPass();
146 (void) llvm::createPAEvalPass();
147 (void) llvm::createPromoteMemoryToRegisterPass();
148 (void) llvm::createDemoteRegisterToMemoryPass();
149 (void) llvm::createPruneEHPass();
150 (void)llvm::createPostDomOnlyPrinterWrapperPassPass();
151 (void)llvm::createPostDomPrinterWrapperPassPass();
152 (void)llvm::createPostDomOnlyViewerWrapperPassPass();
153 (void)llvm::createPostDomViewerWrapperPassPass();
154 (void) llvm::createReassociatePass();
155 (void) llvm::createRedundantDbgInstEliminationPass();
156 (void) llvm::createRegionInfoPass();
157 (void) llvm::createRegionOnlyPrinterPass();
158 (void) llvm::createRegionOnlyViewerPass();
159 (void) llvm::createRegionPrinterPass();
160 (void) llvm::createRegionViewerPass();
161 (void) llvm::createSCCPPass();
162 (void) llvm::createSafeStackPass();
163 (void) llvm::createSROAPass();
164 (void) llvm::createSingleLoopExtractorPass();
165 (void) llvm::createStripSymbolsPass();
166 (void) llvm::createStripNonDebugSymbolsPass();
167 (void) llvm::createStripDeadDebugInfoPass();
168 (void) llvm::createStripDeadPrototypesPass();
169 (void) llvm::createTailCallEliminationPass();
170 (void)llvm::createTLSVariableHoistPass();
171 (void) llvm::createJumpThreadingPass();
172 (void) llvm::createDFAJumpThreadingPass();
173 (void) llvm::createUnifyFunctionExitNodesPass();
174 (void) llvm::createInstCountPass();
175 (void) llvm::createConstantHoistingPass();
176 (void) llvm::createCodeGenPreparePass();
177 (void) llvm::createEarlyCSEPass();
178 (void) llvm::createGVNHoistPass();
179 (void) llvm::createMergedLoadStoreMotionPass();
180 (void) llvm::createGVNPass();
181 (void) llvm::createNewGVNPass();
182 (void) llvm::createMemCpyOptPass();
183 (void) llvm::createLoopDeletionPass();
184 (void) llvm::createPostDomTree();
185 (void) llvm::createInstructionNamerPass();
186 (void) llvm::createMetaRenamerPass();
187 (void) llvm::createAttributorLegacyPass();
188 (void) llvm::createAttributorCGSCCLegacyPass();
189 (void) llvm::createPostOrderFunctionAttrsLegacyPass();
190 (void) llvm::createReversePostOrderFunctionAttrsPass();
191 (void) llvm::createMergeFunctionsPass();
192 (void) llvm::createMergeICmpsLegacyPass();
193 (void) llvm::createExpandMemCmpPass();
194 (void) llvm::createExpandVectorPredicationPass();
195 std::string buf;
196 llvm::raw_string_ostream os(buf);
197 (void) llvm::createPrintModulePass(os);
198 (void) llvm::createPrintFunctionPass(os);
199 (void) llvm::createModuleDebugInfoPrinterPass();
200 (void) llvm::createPartialInliningPass();
201 (void) llvm::createLintLegacyPassPass();
202 (void) llvm::createSinkingPass();
203 (void) llvm::createLowerAtomicPass();
204 (void) llvm::createCorrelatedValuePropagationPass();
205 (void) llvm::createMemDepPrinter();
206 (void) llvm::createLoopVectorizePass();
207 (void) llvm::createSLPVectorizerPass();
208 (void) llvm::createLoadStoreVectorizerPass();
209 (void) llvm::createVectorCombinePass();
210 (void) llvm::createPartiallyInlineLibCallsPass();
211 (void) llvm::createScalarizerPass();
212 (void) llvm::createSeparateConstOffsetFromGEPPass();
213 (void) llvm::createSpeculativeExecutionPass();
214 (void) llvm::createSpeculativeExecutionIfHasBranchDivergencePass();
215 (void) llvm::createRewriteSymbolsPass();
216 (void) llvm::createStraightLineStrengthReducePass();
217 (void) llvm::createMemDerefPrinter();
218 (void) llvm::createMustExecutePrinter();
219 (void) llvm::createMustBeExecutedContextPrinter();
220 (void) llvm::createFloat2IntPass();
221 (void) llvm::createEliminateAvailableExternallyPass();
222 (void)llvm::createScalarizeMaskedMemIntrinLegacyPass();
223 (void) llvm::createWarnMissedTransformationsPass();
224 (void) llvm::createHardwareLoopsPass();
225 (void) llvm::createInjectTLIMappingsLegacyPass();
226 (void) llvm::createUnifyLoopExitsPass();
227 (void) llvm::createFixIrreduciblePass();
228 (void)llvm::createFunctionSpecializationPass();
229 (void)llvm::createSelectOptimizePass();
230
231 (void)new llvm::IntervalPartition();
232 (void)new llvm::ScalarEvolutionWrapperPass();
233 llvm::Function::Create(nullptr, llvm::GlobalValue::ExternalLinkage)->viewCFGOnly();
234 llvm::RGPassManager RGM;
235 llvm::TargetLibraryInfoImpl TLII;
236 llvm::TargetLibraryInfo TLI(TLII);
237 llvm::AliasAnalysis AA(TLI);
238 llvm::AliasSetTracker X(AA);
239 X.add(nullptr, llvm::LocationSize::beforeOrAfterPointer(),
240 llvm::AAMDNodes()); // for -print-alias-sets
241 (void) llvm::AreStatisticsEnabled();
242 (void) llvm::sys::RunningOnValgrind();
243 }
244 } ForcePassLinking; // Force link by creating a global definition.
245}
246
247#endif
248

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