LLVM 20.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"
34#include "llvm/CodeGen/Passes.h"
35#include "llvm/IR/Function.h"
38#include "llvm/Transforms/IPO.h"
48#include <cstdlib>
49
50namespace {
51struct ForcePassLinking {
52 ForcePassLinking() {
53 // We must reference the passes in such a way that compilers will not
54 // delete it all as dead code, even with whole program optimization,
55 // yet is effectively a NO-OP. As the compiler isn't smart enough
56 // to know that getenv() never returns -1, this will do the job.
57 // This is so that globals in the translation units where these functions
58 // are defined are forced to be initialized, populating various
59 // registries.
60 if (std::getenv("bar") != (char *)-1)
61 return;
62
115 (void)llvm::createSROAPass();
122 (void)llvm::createGVNPass();
127 std::string buf;
145
148 ->viewCFGOnly();
151 llvm::TargetLibraryInfo TLI(TLII);
152 llvm::AliasAnalysis AA(TLI);
153 llvm::BatchAAResults BAA(AA);
155 X.add(llvm::MemoryLocation()); // for -print-alias-sets
158 }
159} ForcePassLinking; // Force link by creating a global definition.
160} // namespace
161
162#endif
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:173
void viewCFGOnly() const
viewCFGOnly - This function is meant for use from the debugger.
Definition: CFGPrinter.cpp:158
@ ExternalLinkage
Externally visible function.
Definition: GlobalValue.h:52
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:541
FunctionPass * createRegionOnlyViewerPass()
FunctionPass * createTailCallEliminationPass()
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...
ModulePass * createGlobalMergeFuncPass()
This pass performs merging similar functions globally.
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 * createRegToMemWrapperPass()
Definition: Reg2Mem.cpp:148
FunctionPass * createDeadCodeEliminationPass()
Definition: DCE.cpp:145
FunctionPass * createSelectOptimizePass()
This pass converts conditional moves to conditional jumps when profitable.
FunctionPass * createRegionPrinterPass()
FunctionPass * createSpeculativeExecutionIfHasBranchDivergencePass()
FunctionPass * createPostInlineEntryExitInstrumenterPass()
FunctionPass * createPostDomViewerWrapperPassPass()
Definition: DomPrinter.cpp:238
ModulePass * createDXILResourceTypeWrapperPassPass()
FunctionPass * createSCEVAAWrapperPass()
Creates an instance of SCEVAAWrapperPass.
FunctionPass * createNaryReassociatePass()
FunctionPass * createScalarizeMaskedMemIntrinLegacyPass()
FunctionPass * createPostDomOnlyPrinterWrapperPassPass()
Definition: DomPrinter.cpp:234
Pass * createLoopTermFoldPass()
Pass * createStructurizeCFGPass(bool SkipUniformRegions=false)
When SkipUniformRegions is true the structizer will not structurize regions that only contain uniform...
Pass * createLICMPass()
Definition: LICM.cpp:381
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 * createScalarizerPass(const ScalarizerPassOptions &Options=ScalarizerPassOptions())
Create a legacy pass manager instance of the Scalarizer pass.
Definition: Scalarizer.cpp:444
FunctionPass * createGVNPass(bool NoMemDepAnalysis=false)
Create a legacy GVN pass.
Definition: GVN.cpp:3352
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 * 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:1944
FunctionPass * createRegionInfoPass()
Definition: RegionInfo.cpp:177
Pass * createObjCARCContractPass()
FunctionPass * createDomPrinterWrapperPassPass()
FunctionPass * createSROAPass(bool PreserveCFG=true)
Definition: SROA.cpp:5838
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.
ModulePass * createDXILResourceBindingWrapperPassPass()
FunctionPass * createInstSimplifyLegacyPass()