LLVM 17.0.0git
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"
25#include "llvm/Analysis/Lint.h"
35#include "llvm/CodeGen/Passes.h"
36#include "llvm/IR/Function.h"
40#include "llvm/Transforms/IPO.h"
56#include <cstdlib>
57
58namespace {
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
99 (void) llvm::createLCSSAPass();
101 (void) llvm::createLICMPass();
132 (void) llvm::createSROAPass();
142 (void) llvm::createGVNPass();
150 std::string buf;
176
177 (void)new llvm::IntervalPartition();
182 llvm::TargetLibraryInfo TLI(TLII);
183 llvm::AliasAnalysis AA(TLI);
184 llvm::BatchAAResults BAA(AA);
187 llvm::AAMDNodes()); // for -print-alias-sets
190 }
191 } ForcePassLinking; // Force link by creating a global definition.
192}
193
194#endif
AggressiveInstCombiner - Combine expression patterns to form expressions with fewer,...
This file implements a simple N^2 alias analysis accuracy evaluator.
Provides passes to inlining "always_inline" functions.
This is the interface for LLVM's primary stateless and local alias analysis.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
Provides passes for computing function attributes based on interprocedural analyses.
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
This is the interface for a simple mod/ref and alias analysis over globals.
This file contains an interface for creating legacy passes to print out IR in various granularities.
This file provides the primary interface to the instcombine pass.
Defines passes for running instruction simplification across chunks of IR.
This is the interface for a SCEV-based alias analysis.
This pass converts vector operations into scalar operations, in order to expose optimization opportun...
This is the interface for a metadata-based scoped no-alias analysis.
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
This is the interface for a metadata-based TBAA.
This class is a wrapper over an AAResults, and it is intended to be used only when there are no IR ch...
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
Definition: Function.h:136
void viewCFGOnly() const
viewCFGOnly - This function is meant for use from the debugger.
Definition: CFGPrinter.cpp:278
@ ExternalLinkage
Externally visible function.
Definition: GlobalValue.h:48
static constexpr LocationSize beforeOrAfterPointer()
Any location before or after the base pointer (but still within the underlying object).
The pass manager to schedule RegionPasses.
Definition: RegionPass.h:87
Implementation of the target library information.
Provides information about what library functions are available for the current target.
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:642
bool RunningOnValgrind()
Definition: Valgrind.cpp:32
FunctionPass * createDomOnlyPrinterWrapperPassPass()
Definition: DomPrinter.cpp:218
FunctionPass * createGuardWideningPass()
ModulePass * createCallGraphDOTPrinterPass()
FunctionPass * createPostDomOnlyViewerWrapperPassPass()
Definition: DomPrinter.cpp:242
FunctionPass * createCFGSimplificationPass(SimplifyCFGOptions Options=SimplifyCFGOptions(), std::function< bool(const Function &)> Ftor=nullptr)
FunctionPass * createDemoteRegisterToMemoryPass()
Definition: Reg2Mem.cpp:140
Pass * createRedundantDbgInstEliminationPass()
Pass * createLCSSAPass()
Definition: LCSSA.cpp:491
FunctionPass * createRegionOnlyViewerPass()
FunctionPass * createTailCallEliminationPass()
FunctionPass * createTLSVariableHoistPass()
FunctionPass * createLowerExpectIntrinsicPass()
Pass * createLoadStoreVectorizerPass()
Create a legacy pass manager instance of the LoadStoreVectorizer pass.
FunctionPass * createInstructionCombiningPass()
Pass * createLoopRotatePass(int MaxHeaderSize=-1, bool PrepareForLTO=false)
ModulePass * createDeadArgEliminationPass()
createDeadArgEliminationPass - This pass removes arguments from functions which are not used by the b...
Pass * createInductiveRangeCheckEliminationPass()
FunctionPass * createConstantHoistingPass()
FunctionPass * createBitTrackingDCEPass()
Definition: BDCE.cpp:206
FunctionPass * createSafeStackPass()
This pass splits the stack into a safe stack and an unsafe stack to protect against stack-based overf...
Definition: SafeStack.cpp:939
ModulePass * createMustBeExecutedContextPrinter()
ModulePass * createRewriteSymbolsPass()
ModulePass * createModuleDebugInfoPrinterPass()
FunctionPass * createDeadCodeEliminationPass()
Definition: DCE.cpp:178
FunctionPass * createSelectOptimizePass()
This pass converts conditional moves to conditional jumps when profitable.
FunctionPass * createRegionPrinterPass()
FunctionPass * createSpeculativeExecutionIfHasBranchDivergencePass()
FunctionPass * createExpandVectorPredicationPass()
This pass expands the vector predication intrinsics into unpredicated instructions with selects or ju...
FunctionPass * createPostDomViewerWrapperPassPass()
Definition: DomPrinter.cpp:238
FunctionPass * createSCEVAAWrapperPass()
Creates an instance of SCEVAAWrapperPass.
FunctionPass * createNaryReassociatePass()
FunctionPass * createInstCountPass()
FunctionPass * createScalarizeMaskedMemIntrinLegacyPass()
FunctionPass * createPostDomOnlyPrinterWrapperPassPass()
Definition: DomPrinter.cpp:234
Pass * createUnifyFunctionExitNodesPass()
Pass * createStructurizeCFGPass(bool SkipUniformRegions=false)
When SkipUniformRegions is true the structizer will not structurize regions that only contain uniform...
Pass * createLICMPass()
Definition: LICM.cpp:359
FunctionPass * createMemDerefPrinter()
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)
FunctionPass * createReassociatePass()
FunctionPass * createLazyValueInfoPass()
createLazyValueInfoPass - This creates an instance of the LazyValueInfo pass.
FunctionPass * createAlignmentFromAssumptionsPass()
ModulePass * createJMCInstrumenterPass()
JMC instrument pass.
FunctionPass * createScalarizerPass()
Create a legacy pass manager instance of the Scalarizer pass.
Definition: Scalarizer.cpp:362
Pass * createLoopPredicationPass()
ModulePass * createGlobalsAAWrapperPass()
ModulePass * createCallGraphViewerPass()
ImmutablePass * createScopedNoAliasAAWrapperPass()
FunctionPass * createSinkingPass()
Definition: Sink.cpp:277
FunctionPass * createInjectTLIMappingsLegacyPass()
FunctionPass * createPostDomTree()
ModulePass * createLowerGlobalDtorsLegacyPass()
FunctionPass * createLowerInvokePass()
Definition: LowerInvoke.cpp:85
FunctionPass * createExpandMemCmpPass()
FunctionPass * createRegionOnlyPrinterPass()
FunctionPass * createSpeculativeExecutionPass()
Pass * createLoopExtractorPass()
createLoopExtractorPass - This pass extracts all natural loops from the program into a function if it...
Pass * createSingleLoopExtractorPass()
createSingleLoopExtractorPass - This pass extracts one natural loop from the program into a function ...
FunctionPass * createUnifyLoopExitsPass()
bool AreStatisticsEnabled()
Check if statistics are enabled.
Definition: Statistic.cpp:139
FunctionPass * createFixIrreduciblePass()
Pass * createLowerAtomicPass()
FunctionPass * createBasicAAWrapperPass()
FunctionPass * createLegacyDivergenceAnalysisPass()
Pass * createAlwaysInlinerLegacyPass(bool InsertLifetime=true)
Create a legacy pass manager instance of a pass to inline and remove functions marked as "always_inli...
FunctionPass * createSeparateConstOffsetFromGEPPass(bool LowerGEP=false)
FunctionPass * createExpandLargeDivRemPass()
Pass * createMergeICmpsLegacyPass()
Definition: MergeICmps.cpp:910
ImmutablePass * createTypeBasedAAWrapperPass()
FunctionPass * createMergedLoadStoreMotionPass(bool SplitFooterBB=false)
createMergedLoadStoreMotionPass - The public interface to this file.
FunctionPass * createDomOnlyViewerWrapperPassPass()
Definition: DomPrinter.cpp:226
Pass * createLoopStrengthReducePass()
FunctionPass * createGVNPass(bool NoMemDepAnalysis=false)
Create a legacy GVN pass.
Definition: GVN.cpp:3213
FunctionPass * createLintLegacyPassPass()
Definition: Lint.cpp:766
Pass * createLoopSimplifyCFGPass()
FunctionPass * createInstructionNamerPass()
FunctionPass * createLowerSwitchPass()
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.
FunctionPass * createLowerConstantIntrinsicsPass()
FunctionPass * createCodeGenPreparePass()
createCodeGenPreparePass - Transform the code to expose more pattern matching during instruction sele...
FunctionPass * createRegionViewerPass()
FunctionPass * createPartiallyInlineLibCallsPass()
FunctionPass * createAAEvalPass()
Create a wrapper of the above for the legacy pass manager.
Pass * createLoopSinkPass()
ModulePass * createMetaRenamerPass()
FunctionPass * createBreakCriticalEdgesPass()
FunctionPass * createStraightLineStrengthReducePass()
FunctionPass * createPostDomPrinterWrapperPassPass()
Definition: DomPrinter.cpp:230
FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
Definition: EarlyCSE.cpp:1793
FunctionPass * createCostModelAnalysisPass()
Definition: CostModel.cpp:78
FunctionPass * createRegionInfoPass()
Definition: RegionInfo.cpp:176
FunctionPass * createMemDepPrinter()
Pass * createObjCARCContractPass()
FunctionPass * createDomPrinterWrapperPassPass()
FunctionPass * createSROAPass(bool PreserveCFG=true)
Definition: SROA.cpp:5163
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 * createDomViewerWrapperPassPass()
Definition: DomPrinter.cpp:222
Pass * createLoopSimplifyPass()
FunctionPass * createDependenceAnalysisWrapperPass()
createDependenceAnalysisPass - This creates an instance of the DependenceAnalysis wrapper pass.
FunctionPass * createHardwareLoopsLegacyPass()
Create Hardware Loop pass.
FunctionPass * createInstSimplifyLegacyPass()
Pass * createLoopGuardWideningPass()
FunctionPass * createMustExecutePrinter()
FunctionPass * createPromoteMemoryToRegisterPass(bool IsForced=false)
Definition: Mem2Reg.cpp:118
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
Definition: Metadata.h:651