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 if (std::getenv("bar") != (char*) -1)
68 return;
69
70 (void) llvm::createAAEvalPass();
71 (void) llvm::createAggressiveDCEPass();
72 (void) llvm::createAggressiveInstCombinerPass();
73 (void) llvm::createBitTrackingDCEPass();
74 (void)llvm::createOpenMPOptCGSCCLegacyPass();
75 (void) llvm::createArgumentPromotionPass();
76 (void) llvm::createAlignmentFromAssumptionsPass();
77 (void) llvm::createBasicAAWrapperPass();
78 (void) llvm::createSCEVAAWrapperPass();
79 (void) llvm::createTypeBasedAAWrapperPass();
80 (void) llvm::createScopedNoAliasAAWrapperPass();
81 (void) llvm::createBoundsCheckingLegacyPass();
82 (void) llvm::createBreakCriticalEdgesPass();
83 (void) llvm::createCallGraphDOTPrinterPass();
84 (void) llvm::createCallGraphViewerPass();
85 (void) llvm::createCFGSimplificationPass();
86 (void) llvm::createCFLAndersAAWrapperPass();
87 (void) llvm::createCFLSteensAAWrapperPass();
88 (void) llvm::createStructurizeCFGPass();
89 (void) llvm::createLibCallsShrinkWrapPass();
90 (void) llvm::createCalledValuePropagationPass();
91 (void) llvm::createConstantMergePass();
92 (void) llvm::createControlHeightReductionLegacyPass();
93 (void) llvm::createCostModelAnalysisPass();
94 (void) llvm::createDeadArgEliminationPass();
95 (void) llvm::createDeadCodeEliminationPass();
96 (void) llvm::createDeadStoreEliminationPass();
97 (void) llvm::createDependenceAnalysisWrapperPass();
98 (void) llvm::createDomOnlyPrinterPass();
99 (void) llvm::createDomPrinterPass();
100 (void) llvm::createDomOnlyViewerPass();
101 (void) llvm::createDomViewerPass();
102 (void) llvm::createGCOVProfilerPass();
103 (void) llvm::createPGOInstrumentationGenLegacyPass();
104 (void) llvm::createPGOInstrumentationUseLegacyPass();
105 (void) llvm::createPGOInstrumentationGenCreateVarLegacyPass();
106 (void) llvm::createPGOIndirectCallPromotionLegacyPass();
107 (void) llvm::createPGOMemOPSizeOptLegacyPass();
108 (void) llvm::createInstrProfilingLegacyPass();
109 (void) llvm::createFunctionImportPass();
110 (void) llvm::createFunctionInliningPass();
111 (void) llvm::createAlwaysInlinerLegacyPass();
112 (void) llvm::createGlobalDCEPass();
113 (void) llvm::createGlobalOptimizerPass();
114 (void) llvm::createGlobalsAAWrapperPass();
115 (void) llvm::createGuardWideningPass();
116 (void) llvm::createLoopGuardWideningPass();
117 (void) llvm::createIPSCCPPass();
118 (void) llvm::createInductiveRangeCheckEliminationPass();
119 (void) llvm::createIndVarSimplifyPass();
120 (void) llvm::createInstSimplifyLegacyPass();
121 (void) llvm::createInstructionCombiningPass();
122 (void) llvm::createInternalizePass();
123 (void) llvm::createLCSSAPass();
124 (void) llvm::createLegacyDivergenceAnalysisPass();
125 (void) llvm::createLICMPass();
126 (void) llvm::createLoopSinkPass();
127 (void) llvm::createLazyValueInfoPass();
128 (void) llvm::createLoopExtractorPass();
129 (void) llvm::createLoopInterchangePass();
130 (void) llvm::createLoopFlattenPass();
131 (void) llvm::createLoopPredicationPass();
132 (void) llvm::createLoopSimplifyPass();
133 (void) llvm::createLoopSimplifyCFGPass();
134 (void) llvm::createLoopStrengthReducePass();
135 (void) llvm::createLoopRerollPass();
136 (void) llvm::createLoopUnrollPass();
137 (void) llvm::createLoopUnrollAndJamPass();
138 (void) llvm::createLoopUnswitchPass();
139 (void) llvm::createLoopVersioningLICMPass();
140 (void) llvm::createLoopIdiomPass();
141 (void) llvm::createLoopRotatePass();
142 (void) llvm::createLowerConstantIntrinsicsPass();
143 (void) llvm::createLowerExpectIntrinsicPass();
144 (void) llvm::createLowerInvokePass();
145 (void) llvm::createLowerSwitchPass();
146 (void) llvm::createNaryReassociatePass();
147 (void) llvm::createObjCARCAAWrapperPass();
148 (void) llvm::createObjCARCAPElimPass();
149 (void) llvm::createObjCARCExpandPass();
150 (void) llvm::createObjCARCContractPass();
151 (void) llvm::createObjCARCOptPass();
152 (void) llvm::createPAEvalPass();
153 (void) llvm::createPromoteMemoryToRegisterPass();
154 (void) llvm::createDemoteRegisterToMemoryPass();
155 (void) llvm::createPruneEHPass();
156 (void) llvm::createPostDomOnlyPrinterPass();
157 (void) llvm::createPostDomPrinterPass();
158 (void) llvm::createPostDomOnlyViewerPass();
159 (void) llvm::createPostDomViewerPass();
160 (void) llvm::createReassociatePass();
161 (void) llvm::createRedundantDbgInstEliminationPass();
162 (void) llvm::createRegionInfoPass();
163 (void) llvm::createRegionOnlyPrinterPass();
164 (void) llvm::createRegionOnlyViewerPass();
165 (void) llvm::createRegionPrinterPass();
166 (void) llvm::createRegionViewerPass();
167 (void) llvm::createSCCPPass();
168 (void) llvm::createSafeStackPass();
169 (void) llvm::createSROAPass();
170 (void) llvm::createSingleLoopExtractorPass();
171 (void) llvm::createStripSymbolsPass();
172 (void) llvm::createStripNonDebugSymbolsPass();
173 (void) llvm::createStripDeadDebugInfoPass();
174 (void) llvm::createStripDeadPrototypesPass();
175 (void) llvm::createTailCallEliminationPass();
176 (void) llvm::createJumpThreadingPass();
177 (void) llvm::createUnifyFunctionExitNodesPass();
178 (void) llvm::createInstCountPass();
179 (void) llvm::createConstantHoistingPass();
180 (void) llvm::createCodeGenPreparePass();
181 (void) llvm::createEntryExitInstrumenterPass();
182 (void) llvm::createPostInlineEntryExitInstrumenterPass();
183 (void) llvm::createEarlyCSEPass();
184 (void) llvm::createGVNHoistPass();
185 (void) llvm::createMergedLoadStoreMotionPass();
186 (void) llvm::createGVNPass();
187 (void) llvm::createNewGVNPass();
188 (void) llvm::createMemCpyOptPass();
189 (void) llvm::createLoopDeletionPass();
190 (void) llvm::createPostDomTree();
191 (void) llvm::createInstructionNamerPass();
192 (void) llvm::createMetaRenamerPass();
193 (void) llvm::createAttributorLegacyPass();
194 (void) llvm::createAttributorCGSCCLegacyPass();
195 (void) llvm::createPostOrderFunctionAttrsLegacyPass();
196 (void) llvm::createReversePostOrderFunctionAttrsPass();
197 (void) llvm::createMergeFunctionsPass();
198 (void) llvm::createMergeICmpsLegacyPass();
199 (void) llvm::createExpandMemCmpPass();
200 (void) llvm::createExpandVectorPredicationPass();
201 std::string buf;
202 llvm::raw_string_ostream os(buf);
203 (void) llvm::createPrintModulePass(os);
204 (void) llvm::createPrintFunctionPass(os);
205 (void) llvm::createModuleDebugInfoPrinterPass();
206 (void) llvm::createPartialInliningPass();
207 (void) llvm::createLintLegacyPassPass();
208 (void) llvm::createSinkingPass();
209 (void) llvm::createLowerAtomicPass();
210 (void) llvm::createCorrelatedValuePropagationPass();
211 (void) llvm::createMemDepPrinter();
212 (void) llvm::createLoopVectorizePass();
213 (void) llvm::createSLPVectorizerPass();
214 (void) llvm::createLoadStoreVectorizerPass();
215 (void) llvm::createVectorCombinePass();
216 (void) llvm::createPartiallyInlineLibCallsPass();
217 (void) llvm::createScalarizerPass();
218 (void) llvm::createSeparateConstOffsetFromGEPPass();
219 (void) llvm::createSpeculativeExecutionPass();
220 (void) llvm::createSpeculativeExecutionIfHasBranchDivergencePass();
221 (void) llvm::createRewriteSymbolsPass();
222 (void) llvm::createStraightLineStrengthReducePass();
223 (void) llvm::createMemDerefPrinter();
224 (void) llvm::createMustExecutePrinter();
225 (void) llvm::createMustBeExecutedContextPrinter();
226 (void) llvm::createFloat2IntPass();
227 (void) llvm::createEliminateAvailableExternallyPass();
228 (void)llvm::createScalarizeMaskedMemIntrinLegacyPass();
229 (void) llvm::createWarnMissedTransformationsPass();
230 (void) llvm::createHardwareLoopsPass();
231 (void) llvm::createInjectTLIMappingsLegacyPass();
232 (void) llvm::createUnifyLoopExitsPass();
233 (void) llvm::createFixIrreduciblePass();
234
235 (void)new llvm::IntervalPartition();
236 (void)new llvm::ScalarEvolutionWrapperPass();
237 llvm::Function::Create(nullptr, llvm::GlobalValue::ExternalLinkage)->viewCFGOnly();
238 llvm::RGPassManager RGM;
239 llvm::TargetLibraryInfoImpl TLII;
240 llvm::TargetLibraryInfo TLI(TLII);
241 llvm::AliasAnalysis AA(TLI);
242 llvm::AliasSetTracker X(AA);
243 X.add(nullptr, llvm::LocationSize::beforeOrAfterPointer(),
244 llvm::AAMDNodes()); // for -print-alias-sets
245 (void) llvm::AreStatisticsEnabled();
246 (void) llvm::sys::RunningOnValgrind();
247 }
248 } ForcePassLinking; // Force link by creating a global definition.
249}
250
251#endif
252