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