Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:46

0001 //===- llvm/LinkAllPasses.h ------------ Reference All Passes ---*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This header file pulls in all transformation and analysis passes for tools
0010 // like opt and bugpoint that need this functionality.
0011 //
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_LINKALLPASSES_H
0015 #define LLVM_LINKALLPASSES_H
0016 
0017 #include "llvm/ADT/Statistic.h"
0018 #include "llvm/Analysis/AliasAnalysisEvaluator.h"
0019 #include "llvm/Analysis/AliasSetTracker.h"
0020 #include "llvm/Analysis/BasicAliasAnalysis.h"
0021 #include "llvm/Analysis/CallPrinter.h"
0022 #include "llvm/Analysis/DXILResource.h"
0023 #include "llvm/Analysis/DomPrinter.h"
0024 #include "llvm/Analysis/GlobalsModRef.h"
0025 #include "llvm/Analysis/Passes.h"
0026 #include "llvm/Analysis/PostDominators.h"
0027 #include "llvm/Analysis/RegionPass.h"
0028 #include "llvm/Analysis/RegionPrinter.h"
0029 #include "llvm/Analysis/ScalarEvolution.h"
0030 #include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"
0031 #include "llvm/Analysis/ScopedNoAliasAA.h"
0032 #include "llvm/Analysis/TargetLibraryInfo.h"
0033 #include "llvm/Analysis/TypeBasedAliasAnalysis.h"
0034 #include "llvm/CodeGen/Passes.h"
0035 #include "llvm/IR/Function.h"
0036 #include "llvm/IR/IRPrintingPasses.h"
0037 #include "llvm/Support/Valgrind.h"
0038 #include "llvm/Transforms/IPO.h"
0039 #include "llvm/Transforms/IPO/AlwaysInliner.h"
0040 #include "llvm/Transforms/InstCombine/InstCombine.h"
0041 #include "llvm/Transforms/ObjCARC.h"
0042 #include "llvm/Transforms/Scalar.h"
0043 #include "llvm/Transforms/Scalar/GVN.h"
0044 #include "llvm/Transforms/Scalar/Scalarizer.h"
0045 #include "llvm/Transforms/Utils.h"
0046 #include "llvm/Transforms/Utils/SymbolRewriter.h"
0047 #include "llvm/Transforms/Vectorize/LoadStoreVectorizer.h"
0048 #include <cstdlib>
0049 
0050 namespace {
0051 struct ForcePassLinking {
0052   ForcePassLinking() {
0053     // We must reference the passes in such a way that compilers will not
0054     // delete it all as dead code, even with whole program optimization,
0055     // yet is effectively a NO-OP. As the compiler isn't smart enough
0056     // to know that getenv() never returns -1, this will do the job.
0057     // This is so that globals in the translation units where these functions
0058     // are defined are forced to be initialized, populating various
0059     // registries.
0060     if (std::getenv("bar") != (char *)-1)
0061       return;
0062 
0063     (void)llvm::createAtomicExpandLegacyPass();
0064     (void)llvm::createBasicAAWrapperPass();
0065     (void)llvm::createSCEVAAWrapperPass();
0066     (void)llvm::createTypeBasedAAWrapperPass();
0067     (void)llvm::createScopedNoAliasAAWrapperPass();
0068     (void)llvm::createBreakCriticalEdgesPass();
0069     (void)llvm::createCallGraphDOTPrinterPass();
0070     (void)llvm::createCallGraphViewerPass();
0071     (void)llvm::createCFGSimplificationPass();
0072     (void)llvm::createStructurizeCFGPass();
0073     (void)llvm::createDXILResourceBindingWrapperPassPass();
0074     (void)llvm::createDXILResourceTypeWrapperPassPass();
0075     (void)llvm::createDeadArgEliminationPass();
0076     (void)llvm::createDeadCodeEliminationPass();
0077     (void)llvm::createDependenceAnalysisWrapperPass();
0078     (void)llvm::createDomOnlyPrinterWrapperPassPass();
0079     (void)llvm::createDomPrinterWrapperPassPass();
0080     (void)llvm::createDomOnlyViewerWrapperPassPass();
0081     (void)llvm::createDomViewerWrapperPassPass();
0082     (void)llvm::createAlwaysInlinerLegacyPass();
0083     (void)llvm::createGlobalMergeFuncPass();
0084     (void)llvm::createGlobalsAAWrapperPass();
0085     (void)llvm::createInstSimplifyLegacyPass();
0086     (void)llvm::createInstructionCombiningPass();
0087     (void)llvm::createJMCInstrumenterPass();
0088     (void)llvm::createKCFIPass();
0089     (void)llvm::createLCSSAPass();
0090     (void)llvm::createLICMPass();
0091     (void)llvm::createLazyValueInfoPass();
0092     (void)llvm::createLoopExtractorPass();
0093     (void)llvm::createLoopSimplifyPass();
0094     (void)llvm::createLoopStrengthReducePass();
0095     (void)llvm::createLoopTermFoldPass();
0096     (void)llvm::createLoopUnrollPass();
0097     (void)llvm::createLowerGlobalDtorsLegacyPass();
0098     (void)llvm::createLowerInvokePass();
0099     (void)llvm::createLowerSwitchPass();
0100     (void)llvm::createNaryReassociatePass();
0101     (void)llvm::createObjCARCContractPass();
0102     (void)llvm::createPromoteMemoryToRegisterPass();
0103     (void)llvm::createRegToMemWrapperPass();
0104     (void)llvm::createPostDomOnlyPrinterWrapperPassPass();
0105     (void)llvm::createPostDomPrinterWrapperPassPass();
0106     (void)llvm::createPostDomOnlyViewerWrapperPassPass();
0107     (void)llvm::createPostDomViewerWrapperPassPass();
0108     (void)llvm::createReassociatePass();
0109     (void)llvm::createRegionInfoPass();
0110     (void)llvm::createRegionOnlyPrinterPass();
0111     (void)llvm::createRegionOnlyViewerPass();
0112     (void)llvm::createRegionPrinterPass();
0113     (void)llvm::createRegionViewerPass();
0114     (void)llvm::createSafeStackPass();
0115     (void)llvm::createSROAPass();
0116     (void)llvm::createSingleLoopExtractorPass();
0117     (void)llvm::createTailCallEliminationPass();
0118     (void)llvm::createConstantHoistingPass();
0119     (void)llvm::createCodeGenPrepareLegacyPass();
0120     (void)llvm::createPostInlineEntryExitInstrumenterPass();
0121     (void)llvm::createEarlyCSEPass();
0122     (void)llvm::createGVNPass();
0123     (void)llvm::createPostDomTree();
0124     (void)llvm::createMergeICmpsLegacyPass();
0125     (void)llvm::createExpandLargeDivRemPass();
0126     (void)llvm::createExpandMemCmpLegacyPass();
0127     std::string buf;
0128     llvm::raw_string_ostream os(buf);
0129     (void)llvm::createPrintModulePass(os);
0130     (void)llvm::createPrintFunctionPass(os);
0131     (void)llvm::createSinkingPass();
0132     (void)llvm::createLowerAtomicPass();
0133     (void)llvm::createLoadStoreVectorizerPass();
0134     (void)llvm::createPartiallyInlineLibCallsPass();
0135     (void)llvm::createScalarizerPass();
0136     (void)llvm::createSeparateConstOffsetFromGEPPass();
0137     (void)llvm::createSpeculativeExecutionPass();
0138     (void)llvm::createSpeculativeExecutionIfHasBranchDivergencePass();
0139     (void)llvm::createStraightLineStrengthReducePass();
0140     (void)llvm::createScalarizeMaskedMemIntrinLegacyPass();
0141     (void)llvm::createHardwareLoopsLegacyPass();
0142     (void)llvm::createUnifyLoopExitsPass();
0143     (void)llvm::createFixIrreduciblePass();
0144     (void)llvm::createSelectOptimizePass();
0145 
0146     (void)new llvm::ScalarEvolutionWrapperPass();
0147     llvm::Function::Create(nullptr, llvm::GlobalValue::ExternalLinkage)
0148         ->viewCFGOnly();
0149     llvm::RGPassManager RGM;
0150     llvm::TargetLibraryInfoImpl TLII;
0151     llvm::TargetLibraryInfo TLI(TLII);
0152     llvm::AliasAnalysis AA(TLI);
0153     llvm::BatchAAResults BAA(AA);
0154     llvm::AliasSetTracker X(BAA);
0155     X.add(llvm::MemoryLocation()); // for -print-alias-sets
0156     (void)llvm::AreStatisticsEnabled();
0157     (void)llvm::sys::RunningOnValgrind();
0158   }
0159 } ForcePassLinking; // Force link by creating a global definition.
0160 } // namespace
0161 
0162 #endif