• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- llvm/LinkAllPasses.h ------------ Reference All Passes ---*- C++ -*-===//
2 //
3 //                      The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This header file pulls in all transformation and analysis passes for tools
11 // like opt and bugpoint that need this functionality.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LINKALLPASSES_H
16 #define LLVM_LINKALLPASSES_H
17 
18 #include "llvm/Analysis/AliasSetTracker.h"
19 #include "llvm/Analysis/DomPrinter.h"
20 #include "llvm/Analysis/FindUsedTypes.h"
21 #include "llvm/Analysis/IntervalPartition.h"
22 #include "llvm/Analysis/Passes.h"
23 #include "llvm/Analysis/PostDominators.h"
24 #include "llvm/Analysis/RegionPass.h"
25 #include "llvm/Analysis/RegionPrinter.h"
26 #include "llvm/Analysis/ScalarEvolution.h"
27 #include "llvm/Analysis/Lint.h"
28 #include "llvm/Assembly/PrintModulePass.h"
29 #include "llvm/CodeGen/Passes.h"
30 #include "llvm/Function.h"
31 #include "llvm/Transforms/Instrumentation.h"
32 #include "llvm/Transforms/IPO.h"
33 #include "llvm/Transforms/Scalar.h"
34 #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
35 #include <cstdlib>
36 
37 namespace {
38   struct ForcePassLinking {
ForcePassLinkingForcePassLinking39     ForcePassLinking() {
40       // We must reference the passes in such a way that compilers will not
41       // delete it all as dead code, even with whole program optimization,
42       // yet is effectively a NO-OP. As the compiler isn't smart enough
43       // to know that getenv() never returns -1, this will do the job.
44       if (std::getenv("bar") != (char*) -1)
45         return;
46 
47       (void) llvm::createAAEvalPass();
48       (void) llvm::createAggressiveDCEPass();
49       (void) llvm::createAliasAnalysisCounterPass();
50       (void) llvm::createAliasDebugger();
51       (void) llvm::createArgumentPromotionPass();
52       (void) llvm::createBasicAliasAnalysisPass();
53       (void) llvm::createLibCallAliasAnalysisPass(0);
54       (void) llvm::createScalarEvolutionAliasAnalysisPass();
55       (void) llvm::createTypeBasedAliasAnalysisPass();
56       (void) llvm::createBlockPlacementPass();
57       (void) llvm::createBreakCriticalEdgesPass();
58       (void) llvm::createCFGSimplificationPass();
59       (void) llvm::createConstantMergePass();
60       (void) llvm::createConstantPropagationPass();
61       (void) llvm::createDeadArgEliminationPass();
62       (void) llvm::createDeadCodeEliminationPass();
63       (void) llvm::createDeadInstEliminationPass();
64       (void) llvm::createDeadStoreEliminationPass();
65       (void) llvm::createDomOnlyPrinterPass();
66       (void) llvm::createDomPrinterPass();
67       (void) llvm::createDomOnlyViewerPass();
68       (void) llvm::createDomViewerPass();
69       (void) llvm::createEdgeProfilerPass();
70       (void) llvm::createOptimalEdgeProfilerPass();
71       (void) llvm::createPathProfilerPass();
72       (void) llvm::createGCOVProfilerPass(true, true, false);
73       (void) llvm::createFunctionInliningPass();
74       (void) llvm::createAlwaysInlinerPass();
75       (void) llvm::createGlobalDCEPass();
76       (void) llvm::createGlobalOptimizerPass();
77       (void) llvm::createGlobalsModRefPass();
78       (void) llvm::createIPConstantPropagationPass();
79       (void) llvm::createIPSCCPPass();
80       (void) llvm::createIndVarSimplifyPass();
81       (void) llvm::createInstructionCombiningPass();
82       (void) llvm::createInternalizePass(false);
83       (void) llvm::createLCSSAPass();
84       (void) llvm::createLICMPass();
85       (void) llvm::createLazyValueInfoPass();
86       (void) llvm::createLoopDependenceAnalysisPass();
87       (void) llvm::createLoopExtractorPass();
88       (void) llvm::createLoopSimplifyPass();
89       (void) llvm::createLoopStrengthReducePass();
90       (void) llvm::createLoopUnrollPass();
91       (void) llvm::createLoopUnswitchPass();
92       (void) llvm::createLoopIdiomPass();
93       (void) llvm::createLoopRotatePass();
94       (void) llvm::createLowerExpectIntrinsicPass();
95       (void) llvm::createLowerInvokePass();
96       (void) llvm::createLowerSetJmpPass();
97       (void) llvm::createLowerSwitchPass();
98       (void) llvm::createNoAAPass();
99       (void) llvm::createNoProfileInfoPass();
100       (void) llvm::createObjCARCAliasAnalysisPass();
101       (void) llvm::createObjCARCExpandPass();
102       (void) llvm::createObjCARCContractPass();
103       (void) llvm::createObjCARCOptPass();
104       (void) llvm::createProfileEstimatorPass();
105       (void) llvm::createProfileVerifierPass();
106       (void) llvm::createPathProfileVerifierPass();
107       (void) llvm::createProfileLoaderPass();
108       (void) llvm::createPathProfileLoaderPass();
109       (void) llvm::createPromoteMemoryToRegisterPass();
110       (void) llvm::createDemoteRegisterToMemoryPass();
111       (void) llvm::createPruneEHPass();
112       (void) llvm::createPostDomOnlyPrinterPass();
113       (void) llvm::createPostDomPrinterPass();
114       (void) llvm::createPostDomOnlyViewerPass();
115       (void) llvm::createPostDomViewerPass();
116       (void) llvm::createReassociatePass();
117       (void) llvm::createRegionInfoPass();
118       (void) llvm::createRegionOnlyPrinterPass();
119       (void) llvm::createRegionOnlyViewerPass();
120       (void) llvm::createRegionPrinterPass();
121       (void) llvm::createRegionViewerPass();
122       (void) llvm::createSCCPPass();
123       (void) llvm::createScalarReplAggregatesPass();
124       (void) llvm::createSimplifyLibCallsPass();
125       (void) llvm::createSingleLoopExtractorPass();
126       (void) llvm::createStripSymbolsPass();
127       (void) llvm::createStripNonDebugSymbolsPass();
128       (void) llvm::createStripDeadDebugInfoPass();
129       (void) llvm::createStripDeadPrototypesPass();
130       (void) llvm::createTailCallEliminationPass();
131       (void) llvm::createTailDuplicationPass();
132       (void) llvm::createJumpThreadingPass();
133       (void) llvm::createUnifyFunctionExitNodesPass();
134       (void) llvm::createInstCountPass();
135       (void) llvm::createCodeGenPreparePass();
136       (void) llvm::createEarlyCSEPass();
137       (void) llvm::createGVNPass();
138       (void) llvm::createMemCpyOptPass();
139       (void) llvm::createLoopDeletionPass();
140       (void) llvm::createPostDomTree();
141       (void) llvm::createInstructionNamerPass();
142       (void) llvm::createFunctionAttrsPass();
143       (void) llvm::createMergeFunctionsPass();
144       (void) llvm::createPrintModulePass(0);
145       (void) llvm::createPrintFunctionPass("", 0);
146       (void) llvm::createDbgInfoPrinterPass();
147       (void) llvm::createModuleDebugInfoPrinterPass();
148       (void) llvm::createPartialInliningPass();
149       (void) llvm::createLintPass();
150       (void) llvm::createSinkingPass();
151       (void) llvm::createLowerAtomicPass();
152       (void) llvm::createCorrelatedValuePropagationPass();
153       (void) llvm::createMemDepPrinter();
154       (void) llvm::createInstructionSimplifierPass();
155 
156       (void)new llvm::IntervalPartition();
157       (void)new llvm::FindUsedTypes();
158       (void)new llvm::ScalarEvolution();
159       ((llvm::Function*)0)->viewCFGOnly();
160       llvm::RGPassManager RGM(0);
161       ((llvm::RegionPass*)0)->runOnRegion((llvm::Region*)0, RGM);
162       llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0);
163       X.add((llvm::Value*)0, 0, 0);  // for -print-alias-sets
164     }
165   } ForcePassLinking; // Force link by creating a global definition.
166 }
167 
168 #endif
169