LLVM  10.0.0
LinkAllPasses.h
Go to the documentation of this file.
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"
27 #include "llvm/Analysis/Lint.h"
28 #include "llvm/Analysis/Passes.h"
37 #include "llvm/CodeGen/Passes.h"
38 #include "llvm/IR/Function.h"
40 #include "llvm/Support/Valgrind.h"
42 #include "llvm/Transforms/IPO.h"
50 #include "llvm/Transforms/Scalar.h"
54 #include "llvm/Transforms/Utils.h"
58 #include <cstdlib>
59 
60 namespace {
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();
102  (void) llvm::createDomViewerPass();
113  (void) llvm::createGlobalDCEPass();
119  (void) llvm::createIPSCCPPass();
125  (void) llvm::createLCSSAPass();
127  (void) llvm::createLICMPass();
128  (void) llvm::createLoopSinkPass();
141  (void) llvm::createLoopIdiomPass();
153  (void) llvm::createPAEvalPass();
156  (void) llvm::createPruneEHPass();
168  (void) llvm::createSCCPPass();
169  (void) llvm::createSafeStackPass();
170  (void) llvm::createSROAPass();
179  (void) llvm::createInstCountPass();
184  (void) llvm::createEarlyCSEPass();
185  (void) llvm::createGVNHoistPass();
187  (void) llvm::createGVNPass();
188  (void) llvm::createNewGVNPass();
189  (void) llvm::createMemCpyOptPass();
191  (void) llvm::createPostDomTree();
200  std::string buf;
201  llvm::raw_string_ostream os(buf);
202  (void) llvm::createPrintModulePass(os);
206  (void) llvm::createLintPass();
207  (void) llvm::createSinkingPass();
210  (void) llvm::createMemDepPrinter();
224  (void) llvm::createFloat2IntPass();
230 
231  (void)new llvm::IntervalPartition();
236  llvm::TargetLibraryInfo TLI(TLII);
237  llvm::AliasAnalysis AA(TLI);
239  X.add(nullptr, llvm::LocationSize::unknown(),
240  llvm::AAMDNodes()); // for -print-alias-sets
243  }
244  } ForcePassLinking; // Force link by creating a global definition.
245 }
246 
247 #endif
FunctionPass * createSpeculativeExecutionPass()
Defines passes for running instruction simplification across chunks of IR.
FunctionPass * createRegionViewerPass()
ModulePass * createPGOInstrumentationGenLegacyPass(bool IsCS=false)
FunctionPass * createInstCountPass()
FunctionPass * createStraightLineStrengthReducePass()
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...
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...
ModulePass * createMergeFunctionsPass()
createMergeFunctionsPass - This pass discovers identical functions and collapses them.
This is the interface for a simple mod/ref and alias analysis over globals.
ModulePass * createGCOVProfilerPass(const GCOVOptions &Options=GCOVOptions::getDefault())
FunctionPass * createPGOMemOPSizeOptLegacyPass()
static constexpr LocationSize unknown()
Pass * createDeadInstEliminationPass()
This file implements a simple N^2 alias analysis accuracy evaluator.
Pass * createLoopVectorizePass()
This is the interface for a metadata-based scoped no-alias analysis.
FunctionPass * createExpandMemCmpPass()
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...
FunctionPass * createLowerSwitchPass()
ModulePass * createIPSCCPPass()
createIPSCCPPass - This pass propagates constants from call sites into the bodies of functions...
Definition: SCCP.cpp:93
FunctionPass * createFloat2IntPass()
Definition: Float2Int.cpp:540
FunctionPass * createRegionInfoPass()
Definition: RegionInfo.cpp:178
Externally visible function.
Definition: GlobalValue.h:48
Pass * createLCSSAPass()
Definition: LCSSA.cpp:467
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:1211
FunctionPass * createDemoteRegisterToMemoryPass()
Definition: Reg2Mem.cpp:127
FunctionPass * createBoundsCheckingLegacyPass()
Legacy pass creation function for the above pass.
The pass manager to schedule RegionPasses.
Definition: RegionPass.h:88
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 * createPGOInstrumentationGenCreateVarLegacyPass(StringRef CSInstrName=StringRef(""))
Pass * createMergeICmpsLegacyPass()
Definition: MergeICmps.cpp:931
FunctionPass * createHardwareLoopsPass()
Create Hardware Loop pass.
FunctionPass * createCFGSimplificationPass(unsigned Threshold=1, bool ForwardSwitchCond=false, bool ConvertSwitch=false, bool KeepLoops=true, bool SinkCommon=false, std::function< bool(const Function &)> Ftor=nullptr)
ModulePass * createStripDeadDebugInfoPass()
ModulePass * createInstrProfilingLegacyPass(const InstrProfOptions &Options=InstrProfOptions(), bool IsCS=false)
Insert frontend instrumentation based profiling. Parameter IsCS indicates if.
ModulePass * createPartialInliningPass()
createPartialInliningPass - This pass inlines parts of functions.
This is the interface for a SCEV-based alias analysis.
FunctionPass * createMergedLoadStoreMotionPass(bool SplitFooterBB=false)
createMergedLoadStoreMotionPass - The public interface to this file.
FunctionPass * createLowerInvokePass()
Definition: LowerInvoke.cpp:87
FunctionPass * createDomViewerPass()
Definition: DomPrinter.cpp:276
FunctionPass * createSafeStackPass()
This pass splits the stack into a safe stack and an unsafe stack to protect against stack-based overf...
Definition: SafeStack.cpp:903
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:304
FunctionPass * createAggressiveInstCombinerPass()
FunctionPass * createSCCPPass()
Definition: SCCP.cpp:1918
FunctionPass * createPartiallyInlineLibCallsPass()
Pass * createObjCARCAPElimPass()
FunctionPass * createDeadCodeEliminationPass()
Definition: DCE.cpp:213
Pass * createRedundantDbgInstEliminationPass()
Pass * createObjCARCContractPass()
FunctionPass * createSCEVAAWrapperPass()
Creates an instance of SCEVAAWrapperPass.
ModulePass * createMetaRenamerPass()
ModulePass * createCalledValuePropagationPass()
createCalledValuePropagationPass - Attach metadata to indirct call sites indicating the set of functi...
FunctionPass * createInstSimplifyLegacyPass()
Create a legacy pass that does instruction simplification on each instruction in a function...
FunctionPass * createRegionOnlyPrinterPass()
Pass * createLoadStoreVectorizerPass()
Create a legacy pass manager instance of the LoadStoreVectorizer pass.
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 * createLoopUnrollAndJamPass(int OptLevel=2)
Pass * createCorrelatedValuePropagationPass()
FunctionPass * createMustExecutePrinter()
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:189
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
Definition: Function.h:135
FunctionPass * createMemDepPrinter()
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:114
This file provides the primary interface to the instcombine pass.
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:316
FunctionPass * createDeadStoreEliminationPass()
Pass * createLoopPredicationPass()
FunctionPass * createGuardWideningPass()
FunctionPass * createMemCpyOptPass()
The public interface to this file...
FunctionPass * createBitTrackingDCEPass()
Definition: BDCE.cpp:184
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:3061
Pass * createReversePostOrderFunctionAttrsPass()
createReversePostOrderFunctionAttrsPass - This pass walks SCCs of the call graph in RPO to deduce and...
FunctionPass * createInjectTLIMappingsLegacyPass()
Pass * createWarnMissedTransformationsPass()
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:734
Provides passes to inlining "always_inline" functions.
This file provides the primary interface to the aggressive instcombine pass.
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.
FunctionPass * createLowerConstantIntrinsicsPass()
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
Definition: Metadata.h:644
Pass * createLoopSimplifyCFGPass()
Pass * createLowerAtomicPass()
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 * createPAEvalPass()
FunctionPass * createLibCallsShrinkWrapPass()
This pass converts vector operations into scalar operations, in order to expose optimization opportun...
ModulePass * createPGOInstrumentationUseLegacyPass(StringRef Filename=StringRef(""), bool IsCS=false)
Pass * createLoopDeletionPass()
FunctionPass * createSeparateConstOffsetFromGEPPass(bool LowerGEP=false)
FunctionPass * createBasicAAWrapperPass()
Pass * createObjCARCOptPass()
bool RunningOnValgrind()
Definition: Valgrind.cpp:32
Pass * createLoopUnswitchPass(bool OptimizeForSize=false, bool hasBranchDivergence=false)
FunctionPass * createPostInlineEntryExitInstrumenterPass()
FunctionPass * createCodeGenPreparePass()
createCodeGenPreparePass - Transform the code to expose more pattern matching during instruction sele...
Pass * createLoopIdiomPass()
FunctionPass * createLegacyDivergenceAnalysisPass()
ModulePass * createModuleDebugInfoPrinterPass()
Pass * createAttributorLegacyPass()
ModulePass * createGlobalsAAWrapperPass()
ModulePass * createMustBeExecutedContextPrinter()
FunctionPass * createSROAPass()
Definition: SROA.cpp:4653
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:79
ImmutablePass * createTypeBasedAAWrapperPass()
FunctionPass * createPostDomOnlyPrinterPass()
Definition: DomPrinter.cpp:288
Pass * createLoopUnrollPass(int OptLevel=2, bool OnlyWhenForced=false, bool ForgetAllSCEV=false, int Threshold=-1, int Count=-1, int AllowPartial=-1, int Runtime=-1, int UpperBound=-1, int AllowPeeling=-1)
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:516
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:61
ModulePass * createStripSymbolsPass(bool OnlyDebugInfo=false)
FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
Definition: EarlyCSE.cpp:1449
FunctionPass * createScalarizerPass()
Create a legacy pass manager instance of the Scalarizer pass.
Definition: Scalarizer.cpp:321
FunctionPass * createNewGVNPass()
Definition: NewGVN.cpp:4224
This is the interface for LLVM&#39;s primary stateless and local alias analysis.
FunctionPass * createControlHeightReductionLegacyPass()
ImmutablePass * createCFLAndersAAWrapperPass()
FunctionPass * createEntryExitInstrumenterPass()
Pass * createLoopGuardWideningPass()
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:131
Pass * createLoopRotatePass(int MaxHeaderSize=-1)
Pass * createIndVarSimplifyPass()
FunctionPass * createGVNPass(bool NoMemDepAnalysis=false)
Create a legacy GVN pass.
Definition: GVN.cpp:2743
Pass * createInductiveRangeCheckEliminationPass()
FunctionPass * createAggressiveDCEPass()
Definition: ADCE.cpp:739
FunctionPass * createLowerExpectIntrinsicPass()
ImmutablePass * createObjCARCAAWrapperPass()
ModulePass * createCallGraphViewerPass()
FunctionPass * createConstantHoistingPass()
FunctionPass * createNaryReassociatePass()