1 //===- llvm/LinkAllPasses.h ------------ Reference All Passes ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header file pulls in all transformation and analysis passes for tools
11 // like opt and bugpoint that need this functionality.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LINKALLPASSES_H
16 #define LLVM_LINKALLPASSES_H
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"
38 struct 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)
47 (void) llvm::createAAEvalPass();
48 (void) llvm::createAggressiveDCEPass();
49 (void) llvm::createAliasAnalysisCounterPass();
50 (void) llvm::createAliasDebugger();
51 (void) llvm::createArgumentPromotionPass();
52 (void) llvm::createStructRetPromotionPass();
53 (void) llvm::createBasicAliasAnalysisPass();
54 (void) llvm::createLibCallAliasAnalysisPass(0);
55 (void) llvm::createScalarEvolutionAliasAnalysisPass();
56 (void) llvm::createTypeBasedAliasAnalysisPass();
57 (void) llvm::createBlockPlacementPass();
58 (void) llvm::createBreakCriticalEdgesPass();
59 (void) llvm::createCFGSimplificationPass();
60 (void) llvm::createConstantMergePass();
61 (void) llvm::createConstantPropagationPass();
62 (void) llvm::createDeadArgEliminationPass();
63 (void) llvm::createDeadCodeEliminationPass();
64 (void) llvm::createDeadInstEliminationPass();
65 (void) llvm::createDeadStoreEliminationPass();
66 (void) llvm::createDeadTypeEliminationPass();
67 (void) llvm::createDomOnlyPrinterPass();
68 (void) llvm::createDomPrinterPass();
69 (void) llvm::createDomOnlyViewerPass();
70 (void) llvm::createDomViewerPass();
71 (void) llvm::createEdgeProfilerPass();
72 (void) llvm::createOptimalEdgeProfilerPass();
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::createLiveValuesPass();
87 (void) llvm::createLoopDependenceAnalysisPass();
88 (void) llvm::createLoopExtractorPass();
89 (void) llvm::createLoopSimplifyPass();
90 (void) llvm::createLoopStrengthReducePass();
91 (void) llvm::createLoopUnrollPass();
92 (void) llvm::createLoopUnswitchPass();
93 (void) llvm::createLoopRotatePass();
94 (void) llvm::createLowerInvokePass();
95 (void) llvm::createLowerSetJmpPass();
96 (void) llvm::createLowerSwitchPass();
97 (void) llvm::createNoAAPass();
98 (void) llvm::createNoProfileInfoPass();
99 (void) llvm::createProfileEstimatorPass();
100 (void) llvm::createProfileVerifierPass();
101 (void) llvm::createProfileLoaderPass();
102 (void) llvm::createPromoteMemoryToRegisterPass();
103 (void) llvm::createDemoteRegisterToMemoryPass();
104 (void) llvm::createPruneEHPass();
105 (void) llvm::createPostDomOnlyPrinterPass();
106 (void) llvm::createPostDomPrinterPass();
107 (void) llvm::createPostDomOnlyViewerPass();
108 (void) llvm::createPostDomViewerPass();
109 (void) llvm::createReassociatePass();
110 (void) llvm::createRegionInfoPass();
111 (void) llvm::createRegionOnlyPrinterPass();
112 (void) llvm::createRegionOnlyViewerPass();
113 (void) llvm::createRegionPrinterPass();
114 (void) llvm::createRegionViewerPass();
115 (void) llvm::createSCCPPass();
116 (void) llvm::createScalarReplAggregatesPass();
117 (void) llvm::createSimplifyLibCallsPass();
118 (void) llvm::createSimplifyHalfPowrLibCallsPass();
119 (void) llvm::createSingleLoopExtractorPass();
120 (void) llvm::createStripSymbolsPass();
121 (void) llvm::createStripNonDebugSymbolsPass();
122 (void) llvm::createStripDeadDebugInfoPass();
123 (void) llvm::createStripDeadPrototypesPass();
124 (void) llvm::createTailCallEliminationPass();
125 (void) llvm::createTailDuplicationPass();
126 (void) llvm::createJumpThreadingPass();
127 (void) llvm::createUnifyFunctionExitNodesPass();
128 (void) llvm::createInstCountPass();
129 (void) llvm::createCodeGenPreparePass();
130 (void) llvm::createGVNPass();
131 (void) llvm::createMemCpyOptPass();
132 (void) llvm::createLoopDeletionPass();
133 (void) llvm::createPostDomTree();
134 (void) llvm::createPostDomFrontier();
135 (void) llvm::createInstructionNamerPass();
136 (void) llvm::createPartialSpecializationPass();
137 (void) llvm::createFunctionAttrsPass();
138 (void) llvm::createMergeFunctionsPass();
139 (void) llvm::createPrintModulePass(0);
140 (void) llvm::createPrintFunctionPass("", 0);
141 (void) llvm::createDbgInfoPrinterPass();
142 (void) llvm::createModuleDebugInfoPrinterPass();
143 (void) llvm::createPartialInliningPass();
144 (void) llvm::createGEPSplitterPass();
145 (void) llvm::createLintPass();
146 (void) llvm::createSinkingPass();
147 (void) llvm::createLowerAtomicPass();
148 (void) llvm::createCorrelatedValuePropagationPass();
149 (void) llvm::createMemDepPrinter();
151 (void)new llvm::IntervalPartition();
152 (void)new llvm::FindUsedTypes();
153 (void)new llvm::ScalarEvolution();
154 ((llvm::Function*)0)->viewCFGOnly();
155 llvm::RGPassManager RGM(0);
156 ((llvm::RegionPass*)0)->runOnRegion((llvm::Region*)0, RGM);
157 llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0);
158 X.add((llvm::Value*)0, 0, 0); // for -print-alias-sets
160 } ForcePassLinking; // Force link by creating a global definition.