LLVM 19.0.0git
Go to the documentation of this file.
1//===- llvm/LinkAllPasses.h ------------ Reference All Passes ---*- C++ -*-===//
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
9// This header file pulls in all transformation and analysis passes for tools
10// like opt and bugpoint that need this functionality.
17#include "llvm/ADT/Statistic.h"
33#include "llvm/CodeGen/Passes.h"
34#include "llvm/IR/Function.h"
37#include "llvm/Transforms/IPO.h"
47#include <cstdlib>
49namespace {
50 struct ForcePassLinking {
51 ForcePassLinking() {
52 // We must reference the passes in such a way that compilers will not
53 // delete it all as dead code, even with whole program optimization,
54 // yet is effectively a NO-OP. As the compiler isn't smart enough
55 // to know that getenv() never returns -1, this will do the job.
56 // This is so that globals in the translation units where these functions
57 // are defined are forced to be initialized, populating various
58 // registries.
59 if (std::getenv("bar") != (char*) -1)
60 return;
84 (void) llvm::createKCFIPass();
85 (void) llvm::createLCSSAPass();
86 (void) llvm::createLICMPass();
110 (void) llvm::createSROAPass();
118 (void) llvm::createGVNPass();
124 std::string buf;
146 llvm::TargetLibraryInfo TLI(TLII);
147 llvm::AliasAnalysis AA(TLI);
148 llvm::BatchAAResults BAA(AA);
150 X.add(llvm::MemoryLocation()); // for -print-alias-sets
153 }
154 } ForcePassLinking; // Force link by creating a global definition.
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")
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.
This is the interface for a SCEV-based alias analysis.
This pass converts vector operations into scalar operations (or, optionally, operations on smaller ve...
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:164
void viewCFGOnly() const
viewCFGOnly - This function is meant for use from the debugger.
Definition: CFGPrinter.cpp:152
@ ExternalLinkage
Externally visible function.
Definition: GlobalValue.h:51
Representation for a specific memory location.
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:661
bool RunningOnValgrind()
Definition: Valgrind.cpp:32
FunctionPass * createDomOnlyPrinterWrapperPassPass()
Definition: DomPrinter.cpp:218
ModulePass * createCallGraphDOTPrinterPass()
FunctionPass * createPostDomOnlyViewerWrapperPassPass()
Definition: DomPrinter.cpp:242
FunctionPass * createCFGSimplificationPass(SimplifyCFGOptions Options=SimplifyCFGOptions(), std::function< bool(const Function &)> Ftor=nullptr)
Pass * createLCSSAPass()
Definition: LCSSA.cpp:506
FunctionPass * createRegionOnlyViewerPass()
FunctionPass * createTailCallEliminationPass()
FunctionPass * createTLSVariableHoistPass()
Pass * createLoadStoreVectorizerPass()
Create a legacy pass manager instance of the LoadStoreVectorizer pass.
FunctionPass * createPromoteMemoryToRegisterPass()
Definition: Mem2Reg.cpp:114
FunctionPass * createInstructionCombiningPass()
ModulePass * createDeadArgEliminationPass()
createDeadArgEliminationPass - This pass removes arguments from functions which are not used by the b...
FunctionPass * createConstantHoistingPass()
FunctionPass * createSafeStackPass()
This pass splits the stack into a safe stack and an unsafe stack to protect against stack-based overf...
Definition: SafeStack.cpp:974
FunctionPass * createDeadCodeEliminationPass()
Definition: DCE.cpp:145
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 * createPostInlineEntryExitInstrumenterPass()
FunctionPass * createPostDomViewerWrapperPassPass()
Definition: DomPrinter.cpp:238
FunctionPass * createSCEVAAWrapperPass()
Creates an instance of SCEVAAWrapperPass.
FunctionPass * createNaryReassociatePass()
FunctionPass * createScalarizeMaskedMemIntrinLegacyPass()
FunctionPass * createPostDomOnlyPrinterWrapperPassPass()
Definition: DomPrinter.cpp:234
Pass * createStructurizeCFGPass(bool SkipUniformRegions=false)
When SkipUniformRegions is true the structizer will not structurize regions that only contain uniform...
Pass * createLICMPass()
Definition: LICM.cpp:379
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.
ModulePass * createJMCInstrumenterPass()
JMC instrument pass.
ModulePass * createGlobalsAAWrapperPass()
ModulePass * createCallGraphViewerPass()
ImmutablePass * createScopedNoAliasAAWrapperPass()
FunctionPass * createSinkingPass()
Definition: Sink.cpp:277
FunctionPass * createExpandMemCmpLegacyPass()
FunctionPass * createPostDomTree()
ModulePass * createLowerGlobalDtorsLegacyPass()
FunctionPass * createLowerInvokePass()
Definition: LowerInvoke.cpp:85
FunctionPass * createKCFIPass()
Lowers KCFI operand bundles for indirect calls.
Definition: KCFI.cpp:61
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()
FunctionPass * createCodeGenPrepareLegacyPass()
createCodeGenPrepareLegacyPass - Transform the code to expose more pattern matching during instructio...
Pass * createLowerAtomicPass()
FunctionPass * createBasicAAWrapperPass()
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:913
ImmutablePass * createTypeBasedAAWrapperPass()
FunctionPass * createDomOnlyViewerWrapperPassPass()
Definition: DomPrinter.cpp:226
Pass * createLoopStrengthReducePass()
FunctionPass * createGVNPass(bool NoMemDepAnalysis=false)
Create a legacy GVN pass.
Definition: GVN.cpp:3396
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 * createRegionViewerPass()
FunctionPass * createPartiallyInlineLibCallsPass()
FunctionPass * createAtomicExpandLegacyPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
FunctionPass * createBreakCriticalEdgesPass()
FunctionPass * createStraightLineStrengthReducePass()
FunctionPass * createPostDomPrinterWrapperPassPass()
Definition: DomPrinter.cpp:230
FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
Definition: EarlyCSE.cpp:1932
FunctionPass * createRegionInfoPass()
Definition: RegionInfo.cpp:176
Pass * createObjCARCContractPass()
FunctionPass * createDomPrinterWrapperPassPass()
FunctionPass * createSROAPass(bool PreserveCFG=true)
Definition: SROA.cpp:5484
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()