LLVM  6.0.0svn
LinkAllPasses.h
Go to the documentation of this file.
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/ADT/Statistic.h"
28 #include "llvm/Analysis/Lint.h"
29 #include "llvm/Analysis/Passes.h"
38 #include "llvm/CodeGen/Passes.h"
39 #include "llvm/IR/Function.h"
41 #include "llvm/Support/Valgrind.h"
42 #include "llvm/Transforms/IPO.h"
47 #include "llvm/Transforms/Scalar.h"
52 #include <cstdlib>
53 
54 namespace {
55  struct ForcePassLinking {
56  ForcePassLinking() {
57  // We must reference the passes in such a way that compilers will not
58  // delete it all as dead code, even with whole program optimization,
59  // yet is effectively a NO-OP. As the compiler isn't smart enough
60  // to know that getenv() never returns -1, this will do the job.
61  if (std::getenv("bar") != (char*) -1)
62  return;
63 
64  (void) llvm::createAAEvalPass();
105  (void) llvm::createGlobalDCEPass();
110  (void) llvm::createIPSCCPPass();
115  (void) llvm::createLCSSAPass();
116  (void) llvm::createLICMPass();
117  (void) llvm::createLoopSinkPass();
129  (void) llvm::createLoopIdiomPass();
140  (void) llvm::createPAEvalPass();
143  (void) llvm::createPruneEHPass();
154  (void) llvm::createSCCPPass();
155  (void) llvm::createSafeStackPass();
156  (void) llvm::createSROAPass();
165  (void) llvm::createInstCountPass();
169  (void) llvm::createEarlyCSEPass();
170  (void) llvm::createGVNHoistPass();
172  (void) llvm::createGVNPass();
173  (void) llvm::createNewGVNPass();
174  (void) llvm::createMemCpyOptPass();
176  (void) llvm::createPostDomTree();
183  std::string buf;
184  llvm::raw_string_ostream os(buf);
185  (void) llvm::createPrintModulePass(os);
190  (void) llvm::createLintPass();
191  (void) llvm::createSinkingPass();
194  (void) llvm::createMemDepPrinter();
207  (void) llvm::createFloat2IntPass();
210 
211  (void)new llvm::IntervalPartition();
216  llvm::TargetLibraryInfo TLI(TLII);
217  llvm::AliasAnalysis AA(TLI);
219  X.add(nullptr, 0, llvm::AAMDNodes()); // for -print-alias-sets
222  }
223  } ForcePassLinking; // Force link by creating a global definition.
224 }
225 
226 #endif
FunctionPass * createSpeculativeExecutionPass()
FunctionPass * createRegionViewerPass()
FunctionPass * createInstCountPass()
FunctionPass * createStraightLineStrengthReducePass()
FunctionPass * createGVNPass(bool NoLoads=false)
Create a legacy GVN pass.
Definition: GVN.cpp:2549
FunctionPass * createDomOnlyViewerPass()
Definition: DomPrinter.cpp:280
FunctionPass * createDependenceAnalysisWrapperPass()
createDependenceAnalysisPass - This creates an instance of the DependenceAnalysis wrapper pass...
Pass * createLoopRerollPass()
ModulePass * createIPConstantPropagationPass()
createIPConstantPropagationPass - This pass propagates constants from call sites into the bodies of f...
Pass * createLoopSimplifyPass()
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
ModulePass * createStripDeadPrototypesPass()
createStripDeadPrototypesPass - This pass removes any function declarations (prototypes) that are not...
ModulePass * createPGOInstrumentationGenLegacyPass()
FunctionPass * createBoundsCheckingPass()
Pass * createLoopStrengthReducePass()
FunctionPass * createPostDomPrinterPass()
Definition: DomPrinter.cpp:284
This is the interface for LLVM&#39;s inclusion-based alias analysis implemented with CFL graph reachabili...
FunctionPass * createLowerSwitchPass()
This is the interface for a simple mod/ref and alias analysis over globals.
FunctionPass * createPGOMemOPSizeOptLegacyPass()
Pass * createDeadInstEliminationPass()
ModulePass * createGCOVProfilerPass(const GCOVOptions &Options=GCOVOptions::getDefault())
ModulePass * createMergeFunctionsPass()
createMergeFunctionsPass - This pass discovers identical functions and collapses them.
Pass * createLoopUnrollPass(int OptLevel=2, int Threshold=-1, int Count=-1, int AllowPartial=-1, int Runtime=-1, int UpperBound=-1, int AllowPeeling=-1)
This file implements a simple N^2 alias analysis accuracy evaluator.
This is the interface for a metadata-based scoped no-alias analysis.
FunctionPass * createPrintFunctionPass(raw_ostream &OS, const std::string &Banner="")
Create and return a pass that prints functions to the specified raw_ostream as they are processed...
ModulePass * createIPSCCPPass()
createIPSCCPPass - This pass propagates constants from call sites into the bodies of functions...
Definition: SCCP.cpp:1950
FunctionPass * createFloat2IntPass()
Definition: Float2Int.cpp:514
FunctionPass * createRegionInfoPass()
Definition: RegionInfo.cpp:177
Externally visible function.
Definition: GlobalValue.h:49
Pass * createLCSSAPass()
Definition: LCSSA.cpp:411
Implementation of the target library information.
Pass * createSingleLoopExtractorPass()
createSingleLoopExtractorPass - This pass extracts one natural loop from the program into a function ...
FunctionPass * createAAEvalPass()
Create a wrapper of the above for the legacy pass manager.
ModulePass * createEliminateAvailableExternallyPass()
This transform is designed to eliminate available external globals (functions or global variables) ...
FunctionPass * createGVNHoistPass()
Definition: GVNHoist.cpp:1206
FunctionPass * createDemoteRegisterToMemoryPass()
Definition: Reg2Mem.cpp:126
ModulePass * createInstrProfilingLegacyPass(const InstrProfOptions &Options=InstrProfOptions())
Insert frontend instrumentation based profiling.
The pass manager to schedule RegionPasses.
Definition: RegionPass.h:89
ImmutablePass * createScopedNoAliasAAWrapperPass()
FunctionPass * createAlignmentFromAssumptionsPass()
FunctionPass * createJumpThreadingPass(int Threshold=-1)
ModulePass * createCallGraphDOTPrinterPass()
Definition: CallPrinter.cpp:90
FunctionPass * createRegionOnlyViewerPass()
ModulePass * createStripNonDebugSymbolsPass()
FunctionPass * createScalarizeMaskedMemIntrinPass()
createScalarizeMaskedMemIntrinPass - Replace masked load, store, gather and scatter intrinsics with s...
ModulePass * createStripDeadDebugInfoPass()
ModulePass * createPartialInliningPass()
createPartialInliningPass - This pass inlines parts of functions.
This is the interface for a SCEV-based alias analysis.
FunctionPass * createLowerInvokePass()
Definition: LowerInvoke.cpp:84
FunctionPass * createDomViewerPass()
Definition: DomPrinter.cpp:276
FunctionPass * createDivergenceAnalysisPass()
FunctionPass * createSafeStackPass()
This pass splits the stack into a safe stack and an unsafe stack to protect against stack-based overf...
Definition: SafeStack.cpp:849
FunctionPass * createConstantPropagationPass()
FunctionPass * createReassociatePass()
Pass * createArgumentPromotionPass(unsigned maxElements=3)
createArgumentPromotionPass - This pass promotes "by reference" arguments to be passed by value if th...
FunctionPass * createSinkingPass()
Definition: Sink.cpp:306
Pass * createMergeICmpsPass()
Definition: MergeICmps.cpp:653
FunctionPass * createCountingFunctionInserterPass()
Insert mcount-like function calls.
FunctionPass * createSCCPPass()
Definition: SCCP.cpp:1707
FunctionPass * createCFGSimplificationPass(int Threshold=-1, std::function< bool(const Function &)> Ftor=nullptr)
FunctionPass * createPartiallyInlineLibCallsPass()
Pass * createObjCARCAPElimPass()
FunctionPass * createDeadCodeEliminationPass()
Definition: DCE.cpp:161
Pass * createObjCARCContractPass()
FunctionPass * createSCEVAAWrapperPass()
Creates an instance of SCEVAAWrapperPass.
Pass * createLoopVectorizePass(bool NoUnrolling=false, bool AlwaysVectorize=true)
ModulePass * createMetaRenamerPass()
FunctionPass * createRegionOnlyPrinterPass()
Pass * createLoadStoreVectorizerPass()
Pass * createUnifyFunctionExitNodesPass()
FunctionPass * createInstructionCombiningPass(bool ExpensiveCombines=true)
ModulePass * createGlobalDCEPass()
createGlobalDCEPass - This transform is designed to eliminate unreachable internal globals (functions...
FunctionPass * createLazyValueInfoPass()
createLazyValueInfoPass - This creates an instance of the LazyValueInfo pass.
Pass * createCorrelatedValuePropagationPass()
This is the interface for LLVM&#39;s unification-based alias analysis implemented with CFL graph reachabi...
FunctionPass * createDomPrinterPass()
void viewCFGOnly() const
viewCFGOnly - This function is meant for use from the debugger.
Definition: CFGPrinter.cpp:173
FunctionPass * createMemDepPrinter()
FunctionPass * createSeparateConstOffsetFromGEPPass(const TargetMachine *TM=nullptr, bool LowerGEP=false)
This is the interface for a metadata-based TBAA.
Pass * createObjCARCExpandPass()
FunctionPass * createTailCallEliminationPass()
Pass * createFunctionImportPass()
This pass performs iterative function importing from other modules.
This file provides the interface for LLVM&#39;s Global Value Numbering pass which eliminates fully redund...
FunctionPass * createPromoteMemoryToRegisterPass()
Definition: Mem2Reg.cpp:106
FunctionPass * createRegionPrinterPass()
ModulePass * createDeadArgEliminationPass()
createDeadArgEliminationPass - This pass removes arguments from functions which are not used by the b...
FunctionPass * createBreakCriticalEdgesPass()
Pass * createLICMPass()
Definition: LICM.cpp:223
FunctionPass * createDeadStoreEliminationPass()
Pass * createLoopPredicationPass()
ModulePass * createPGOInstrumentationUseLegacyPass(StringRef Filename=StringRef(""))
FunctionPass * createMemCpyOptPass()
The public interface to this file...
FunctionPass * createBitTrackingDCEPass()
Definition: BDCE.cpp:173
Pass * createAlwaysInlinerLegacyPass(bool InsertLifetime=true)
Create a legacy pass manager instance of a pass to inline and remove functions marked as "always_inli...
ModulePass * createConstantMergePass()
createConstantMergePass - This function returns a new pass that merges duplicate global constants tog...
Pass * createLoopSinkPass()
ModulePass * createGlobalOptimizerPass()
createGlobalOptimizerPass - This function returns a new pass that optimizes non-address taken interna...
Definition: GlobalOpt.cpp:2721
Pass * createReversePostOrderFunctionAttrsPass()
createReversePostOrderFunctionAttrsPass - This pass walks SCCs of the call graph in RPO to deduce and...
FunctionPass * createLateCFGSimplificationPass(int Threshold=-1, std::function< bool(const Function &)> Ftor=nullptr)
Pass * createPostOrderFunctionAttrsLegacyPass()
Create a legacy pass manager instance of a pass to compute function attrs in post-order.
Pass * createLoopVersioningLICMPass()
FunctionPass * createLintPass()
Create a lint pass.
Definition: Lint.cpp:713
Provides passes to inlining "always_inline" functions.
FunctionPass * createDomOnlyPrinterPass()
Definition: DomPrinter.cpp:272
Pass * createLoopInterchangePass()
ModulePass * createInternalizePass(std::function< bool(const GlobalValue &)> MustPreserveGV)
createInternalizePass - This pass loops over all of the functions in the input module, internalizing all globals (functions and variables) it can.
Provides information about what library functions are available for the current target.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
Definition: Metadata.h:642
Pass * createLoopSimplifyCFGPass()
Pass * createLowerAtomicPass()
BasicBlockPass * createPrintBasicBlockPass(raw_ostream &OS, const std::string &Banner="")
Create and return a pass that writes the BB to the specified raw_ostream.
FunctionPass * createSpeculativeExecutionIfHasBranchDivergencePass()
ModulePass * createRewriteSymbolsPass()
FunctionPass * createPostDomViewerPass()
Definition: DomPrinter.cpp:292
Pass * createLoopExtractorPass()
createLoopExtractorPass - This pass extracts all natural loops from the program into a function if it...
FunctionPass * createMergedLoadStoreMotionPass()
createMergedLoadStoreMotionPass - The public interface to this file.
FunctionPass * createPAEvalPass()
FunctionPass * createLibCallsShrinkWrapPass()
Pass * createLoopDeletionPass()
FunctionPass * createBasicAAWrapperPass()
Pass * createObjCARCOptPass()
bool RunningOnValgrind()
Definition: Valgrind.cpp:48
Pass * createLoopUnswitchPass(bool OptimizeForSize=false, bool hasBranchDivergence=false)
FunctionPass * createCodeGenPreparePass()
createCodeGenPreparePass - Transform the code to expose more pattern matching during instruction sele...
Pass * createLoopIdiomPass()
ModulePass * createModuleDebugInfoPrinterPass()
ModulePass * createGlobalsAAWrapperPass()
FunctionPass * createSROAPass()
Definition: SROA.cpp:4384
FunctionPass * createInstructionNamerPass()
Provides passes for computing function attributes based on interprocedural analyses.
ImmutablePass * createCFLSteensAAWrapperPass()
FunctionPass * createPostDomOnlyViewerPass()
Definition: DomPrinter.cpp:296
FunctionPass * createCostModelAnalysisPass()
Definition: CostModel.cpp:80
ImmutablePass * createTypeBasedAAWrapperPass()
FunctionPass * createPostDomOnlyPrinterPass()
Definition: DomPrinter.cpp:288
Pass * createSLPVectorizerPass()
ModulePass * createPrintModulePass(raw_ostream &OS, const std::string &Banner="", bool ShouldPreserveUseListOrder=false)
Create and return a pass that writes the module to the specified raw_ostream.
This file defines passes to print out IR in various granularities.
FunctionPass * createPostDomTree()
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:466
Pass * createFunctionInliningPass()
createFunctionInliningPass - Return a new pass object that uses a heuristic to inline direct function...
Pass * createPruneEHPass()
createPruneEHPass - Return a new pass object which transforms invoke instructions into calls...
Definition: PruneEH.cpp:62
ModulePass * createStripSymbolsPass(bool OnlyDebugInfo=false)
FunctionPass * createGuardWideningPass()
FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
Definition: EarlyCSE.cpp:1134
FunctionPass * createScalarizerPass()
Definition: Scalarizer.cpp:800
FunctionPass * createNewGVNPass()
Definition: NewGVN.cpp:4232
This is the interface for LLVM&#39;s primary stateless and local alias analysis.
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, const Twine &N="", Module *M=nullptr)
Definition: Function.h:136
ImmutablePass * createCFLAndersAAWrapperPass()
FunctionPass * createInstructionSimplifierPass()
Pass * createStructurizeCFGPass(bool SkipUniformRegions=false)
When SkipUniformRegions is true the structizer will not structurize regions that only contain uniform...
FunctionPass * createMemDerefPrinter()
ModulePass * createPGOIndirectCallPromotionLegacyPass(bool InLTO=false, bool SamplePGO=false)
bool AreStatisticsEnabled()
Check if statistics are enabled.
Definition: Statistic.cpp:112
Pass * createLoopRotatePass(int MaxHeaderSize=-1)
Pass * createIndVarSimplifyPass()
Pass * createInductiveRangeCheckEliminationPass()
FunctionPass * createAggressiveDCEPass()
Definition: ADCE.cpp:728
FunctionPass * createLowerExpectIntrinsicPass()
ImmutablePass * createObjCARCAAWrapperPass()
ModulePass * createCallGraphViewerPass()
FunctionPass * createConstantHoistingPass()
FunctionPass * createNaryReassociatePass()