1037ce981d8ebbe275236814876441f872d438c26Reid Spencer//===- llvm/LinkAllPasses.h ------------ Reference All Passes ---*- C++ -*-===//
234695381d626485a560594f162701088079589dfMisha Brukman//
3e89c7c616b36378d5eaf19541f4ae79841f9ed8eJeff Cohen//                      The LLVM Compiler Infrastructure
44b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen//
57ed47a13356daed2a34cd2209a31f92552e3bdd8Chris Lattner// This file is distributed under the University of Illinois Open Source
67ed47a13356daed2a34cd2209a31f92552e3bdd8Chris Lattner// License. See LICENSE.TXT for details.
734695381d626485a560594f162701088079589dfMisha Brukman//
84b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen//===----------------------------------------------------------------------===//
94b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen//
1004317cc618aeae28910916469e074d8ce0fcaa03Andrew Trick// This header file pulls in all transformation and analysis passes for tools
11037ce981d8ebbe275236814876441f872d438c26Reid Spencer// like opt and bugpoint that need this functionality.
124b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen//
134b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen//===----------------------------------------------------------------------===//
144b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen
1562c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer#ifndef LLVM_LINKALLPASSES_H
1662c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer#define LLVM_LINKALLPASSES_H
174b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen
1862c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer#include "llvm/Analysis/AliasSetTracker.h"
19a125cacf7d154d0e5cad47f011e619e45517c839Andrew Trick#include "llvm/Analysis/CallPrinter.h"
20b839c5577d8ecb884ffb6874a14782797faec9c4Chris Lattner#include "llvm/Analysis/DomPrinter.h"
2162c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer#include "llvm/Analysis/FindUsedTypes.h"
2262c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer#include "llvm/Analysis/IntervalPartition.h"
23255f89faee13dc491cb64fbeae3c763e7e2ea4e6Chandler Carruth#include "llvm/Analysis/Lint.h"
2462c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer#include "llvm/Analysis/Passes.h"
2562c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer#include "llvm/Analysis/PostDominators.h"
26d8c5ec6aece5732c766bd7d773ff75976d364168Tobias Grosser#include "llvm/Analysis/RegionPass.h"
27f96b0063674e6bf72da5429bd49097e33c2325c7Tobias Grosser#include "llvm/Analysis/RegionPrinter.h"
2862c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer#include "llvm/Analysis/ScalarEvolution.h"
2906deda2d9c8d3117c49704e42b5147df13f42355Jeff Cohen#include "llvm/CodeGen/Passes.h"
300b8c9a80f20772c3793201ab5b251d3520b9cea3Chandler Carruth#include "llvm/IR/Function.h"
3136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#include "llvm/IR/IRPrintingPasses.h"
324b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen#include "llvm/Transforms/IPO.h"
33255f89faee13dc491cb64fbeae3c763e7e2ea4e6Chandler Carruth#include "llvm/Transforms/Instrumentation.h"
3424c4898973a074713201fb9351d302b9f7733e92Michael Gottesman#include "llvm/Transforms/ObjCARC.h"
354b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen#include "llvm/Transforms/Scalar.h"
364b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
37255f89faee13dc491cb64fbeae3c763e7e2ea4e6Chandler Carruth#include "llvm/Transforms/Vectorize.h"
389b2b56ef758ea93082817d421b3fc4cea6daf99eChris Lattner#include <cstdlib>
394b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen
404b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohennamespace {
41534927d82de6d1be0f6e939263eeb309ad135661Jeff Cohen  struct ForcePassLinking {
42534927d82de6d1be0f6e939263eeb309ad135661Jeff Cohen    ForcePassLinking() {
439b2b56ef758ea93082817d421b3fc4cea6daf99eChris Lattner      // We must reference the passes in such a way that compilers will not
44b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      // delete it all as dead code, even with whole program optimization,
45b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      // yet is effectively a NO-OP. As the compiler isn't smart enough
469b2b56ef758ea93082817d421b3fc4cea6daf99eChris Lattner      // to know that getenv() never returns -1, this will do the job.
479b2b56ef758ea93082817d421b3fc4cea6daf99eChris Lattner      if (std::getenv("bar") != (char*) -1)
48b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen        return;
494b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen
50534927d82de6d1be0f6e939263eeb309ad135661Jeff Cohen      (void) llvm::createAAEvalPass();
51b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createAggressiveDCEPass();
52534927d82de6d1be0f6e939263eeb309ad135661Jeff Cohen      (void) llvm::createAliasAnalysisCounterPass();
53472c7918b0bc155e002db6f682c899e21bff852cAndrew Lenharth      (void) llvm::createAliasDebugger();
54b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createArgumentPromotionPass();
55534927d82de6d1be0f6e939263eeb309ad135661Jeff Cohen      (void) llvm::createBasicAliasAnalysisPass();
56dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines      (void) llvm::createLibCallAliasAnalysisPass(nullptr);
572385e0e22ca482f2896dfa975a08db2f54926c09Dan Gohman      (void) llvm::createScalarEvolutionAliasAnalysisPass();
58c182cb5784cfe557f3c8fa6cfb208c02d2ed42d5Dan Gohman      (void) llvm::createTypeBasedAliasAnalysisPass();
595c525b59d5e0036a778d278eeff4832edfd41357Nuno Lopes      (void) llvm::createBoundsCheckingPass();
60b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createBreakCriticalEdgesPass();
61a125cacf7d154d0e5cad47f011e619e45517c839Andrew Trick      (void) llvm::createCallGraphPrinterPass();
62a125cacf7d154d0e5cad47f011e619e45517c839Andrew Trick      (void) llvm::createCallGraphViewerPass();
63b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createCFGSimplificationPass();
64ad966ea7a81a538425d5319f6d8568e460639e54Matt Arsenault      (void) llvm::createStructurizeCFGPass();
65b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createConstantMergePass();
66b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createConstantPropagationPass();
676bed58ef240b1e1a1fb41fb867a8ba6e7566e0e9Nadav Rotem      (void) llvm::createCostModelAnalysisPass();
68b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createDeadArgEliminationPass();
69b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createDeadCodeEliminationPass();
70b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createDeadInstEliminationPass();
71b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createDeadStoreEliminationPass();
72ad43499fc4c2879e25e8c83ddd556a3079e41516Sebastian Pop      (void) llvm::createDependenceAnalysisPass();
73b839c5577d8ecb884ffb6874a14782797faec9c4Chris Lattner      (void) llvm::createDomOnlyPrinterPass();
74b839c5577d8ecb884ffb6874a14782797faec9c4Chris Lattner      (void) llvm::createDomPrinterPass();
75b839c5577d8ecb884ffb6874a14782797faec9c4Chris Lattner      (void) llvm::createDomOnlyViewerPass();
76b839c5577d8ecb884ffb6874a14782797faec9c4Chris Lattner      (void) llvm::createDomViewerPass();
77e229248cb187a927c6e06c3c4de7b61eae281b1dNick Lewycky      (void) llvm::createGCOVProfilerPass();
78b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createFunctionInliningPass();
793d566ddd05120d1ff85eb4f93283e0e85366fa82Devang Patel      (void) llvm::createAlwaysInlinerPass();
80b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createGlobalDCEPass();
81b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createGlobalOptimizerPass();
8206deda2d9c8d3117c49704e42b5147df13f42355Jeff Cohen      (void) llvm::createGlobalsModRefPass();
83b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createIPConstantPropagationPass();
84b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createIPSCCPPass();
85b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createIndVarSimplifyPass();
86b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createInstructionCombiningPass();
87e5551ed9cec1ae777c4e4b8852a1d7842c2e1c3dRafael Espindola      (void) llvm::createInternalizePass();
88cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines      (void) llvm::createJumpInstrTableInfoPass();
89cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines      (void) llvm::createJumpInstrTablesPass();
9011f510b577878e61e62a3a9c5c8d86483961d20cOwen Anderson      (void) llvm::createLCSSAPass();
91b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createLICMPass();
9210f2d13d580da348ba9769864f02d0d5a862c1e0Chris Lattner      (void) llvm::createLazyValueInfoPass();
93bf65268def058af3e1d35aba233d5f0fd5a80fceJeff Cohen      (void) llvm::createLoopExtractorPass();
94b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createLoopSimplifyPass();
95b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createLoopStrengthReducePass();
96bebe48dbfe00078329341945bfb11f778ace6d12Hal Finkel      (void) llvm::createLoopRerollPass();
97b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createLoopUnrollPass();
98b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createLoopUnswitchPass();
99b0db161f5b85c4a31046d2271d9e270991b53a15Chris Lattner      (void) llvm::createLoopIdiomPass();
1006116fb10359fc62914c37bfb80a80d85b4c5e885Chris Lattner      (void) llvm::createLoopRotatePass();
1019da9934e27dfb48de77b80a3e20ed2d869b52024Jakub Staszak      (void) llvm::createLowerExpectIntrinsicPass();
102b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createLowerInvokePass();
103b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createLowerSwitchPass();
104534927d82de6d1be0f6e939263eeb309ad135661Jeff Cohen      (void) llvm::createNoAAPass();
1059fbd318d36e618fb08fb53bb48b7c848e617a8a7John McCall      (void) llvm::createObjCARCAliasAnalysisPass();
1062f6263c96a6ed234b8d314cc35c8e2fcc3e81cccDan Gohman      (void) llvm::createObjCARCAPElimPass();
1079fbd318d36e618fb08fb53bb48b7c848e617a8a7John McCall      (void) llvm::createObjCARCExpandPass();
1089fbd318d36e618fb08fb53bb48b7c848e617a8a7John McCall      (void) llvm::createObjCARCContractPass();
1099fbd318d36e618fb08fb53bb48b7c848e617a8a7John McCall      (void) llvm::createObjCARCOptPass();
110e60f69c0543993953465863d4b2cf9260c2dad96Jeff Cohen      (void) llvm::createPromoteMemoryToRegisterPass();
111105b2f5374d970822d6f33f7ec5d2ed1e9ef9c29Andrew Lenharth      (void) llvm::createDemoteRegisterToMemoryPass();
112b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createPruneEHPass();
113b839c5577d8ecb884ffb6874a14782797faec9c4Chris Lattner      (void) llvm::createPostDomOnlyPrinterPass();
114b839c5577d8ecb884ffb6874a14782797faec9c4Chris Lattner      (void) llvm::createPostDomPrinterPass();
115b839c5577d8ecb884ffb6874a14782797faec9c4Chris Lattner      (void) llvm::createPostDomOnlyViewerPass();
116b839c5577d8ecb884ffb6874a14782797faec9c4Chris Lattner      (void) llvm::createPostDomViewerPass();
117b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createReassociatePass();
118f96b0063674e6bf72da5429bd49097e33c2325c7Tobias Grosser      (void) llvm::createRegionInfoPass();
119f96b0063674e6bf72da5429bd49097e33c2325c7Tobias Grosser      (void) llvm::createRegionOnlyPrinterPass();
120f96b0063674e6bf72da5429bd49097e33c2325c7Tobias Grosser      (void) llvm::createRegionOnlyViewerPass();
121f96b0063674e6bf72da5429bd49097e33c2325c7Tobias Grosser      (void) llvm::createRegionPrinterPass();
122f96b0063674e6bf72da5429bd49097e33c2325c7Tobias Grosser      (void) llvm::createRegionViewerPass();
123b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createSCCPPass();
124b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createScalarReplAggregatesPass();
125b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createSingleLoopExtractorPass();
126bf65268def058af3e1d35aba233d5f0fd5a80fceJeff Cohen      (void) llvm::createStripSymbolsPass();
127f17fc461d17f9fa85f8fbc140ded8f3c591791e2Devang Patel      (void) llvm::createStripNonDebugSymbolsPass();
12826d14294de179ada3ba472d206bd25e9785f05a3Devang Patel      (void) llvm::createStripDeadDebugInfoPass();
1295f2e4681ce039f29d75fae2d8447e4a31b8e4706Devang Patel      (void) llvm::createStripDeadPrototypesPass();
130b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen      (void) llvm::createTailCallEliminationPass();
1318383a7b7a6acdae478d4b4c2520915153b73f676Chris Lattner      (void) llvm::createJumpThreadingPass();
132bf65268def058af3e1d35aba233d5f0fd5a80fceJeff Cohen      (void) llvm::createUnifyFunctionExitNodesPass();
13362c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer      (void) llvm::createInstCountPass();
13436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines      (void) llvm::createConstantHoistingPass();
135dbe0deca339585dfbaed5951ef0ca2c6a0df173cChris Lattner      (void) llvm::createCodeGenPreparePass();
13612be936cc912b1ff4d1c73c7f2c805a3462da1abChris Lattner      (void) llvm::createEarlyCSEPass();
1371ad2cb75553a30bcec9fdc15733a20df6bc50431Owen Anderson      (void) llvm::createGVNPass();
138a723d1e48f4a261512c28845c53eda569fa5218cOwen Anderson      (void) llvm::createMemCpyOptPass();
1390396cd33ca2d879d1cf0e9b252ce43a760449fffOwen Anderson      (void) llvm::createLoopDeletionPass();
1405771d6c16d71dc3bba59b88592686c76f07f4721Owen Anderson      (void) llvm::createPostDomTree();
1413793325cb3b4d97a295e5aaa419cfcf2866940c9Chris Lattner      (void) llvm::createInstructionNamerPass();
14295f1ef4ac7f3bf7fd0c4636984fe1c5f8e4190a9Alex Rosenberg      (void) llvm::createMetaRenamerPass();
1439e89ba31f16a960239a750a26a982b4c9dfe8949Duncan Sands      (void) llvm::createFunctionAttrsPass();
144579a0246616d76bc536de0e41edf069d091604beNick Lewycky      (void) llvm::createMergeFunctionsPass();
145dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines      (void) llvm::createPrintModulePass(*(llvm::raw_ostream*)nullptr);
146dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines      (void) llvm::createPrintFunctionPass(*(llvm::raw_ostream*)nullptr);
147dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines      (void) llvm::createPrintBasicBlockPass(*(llvm::raw_ostream*)nullptr);
148ef0b14593bb8dd5651606925584adb1ac1096ba5Dan Gohman      (void) llvm::createModuleDebugInfoPrinterPass();
149ca399021d47d640551eb786620bcd108e1758485Owen Anderson      (void) llvm::createPartialInliningPass();
150113902e9fba5f4baf3de3c6ac0241d49ffdfa55cDan Gohman      (void) llvm::createLintPass();
15128a193ed8b4b37593afb76f9130eacf393ea9383Dan Gohman      (void) llvm::createSinkingPass();
1523bababf880bfeaf1bcda7e4f808007621b6bfac8Peter Collingbourne      (void) llvm::createLowerAtomicPass();
15325e9405272630204eb721d8b6ab47a5a25f24885Owen Anderson      (void) llvm::createCorrelatedValuePropagationPass();
154ead0109f5bc010af837d0fa7c9bb2401b34fb29dDan Gohman      (void) llvm::createMemDepPrinter();
15543ff68ded09bf6f722548fa6c62d742483bd133cDuncan Sands      (void) llvm::createInstructionSimplifierPass();
156ae3b652f5cc19d83b6466d4fa70a7d1c7fb6d06cNadav Rotem      (void) llvm::createLoopVectorizePass();
1578383b539ff4c039108ee0c202a27b787621d96cfNadav Rotem      (void) llvm::createSLPVectorizerPass();
158de5e5ec3045a73a06b1054417f9ac6c02929e9ceHal Finkel      (void) llvm::createBBVectorizePass();
159a8a7099c1849fcbb4a68642a292fd0250aa46505Richard Sandiford      (void) llvm::createPartiallyInlineLibCallsPass();
16036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines      (void) llvm::createScalarizerPass();
161dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines      (void) llvm::createSeparateConstOffsetFromGEPPass();
16262c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer
16362c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer      (void)new llvm::IntervalPartition();
16462c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer      (void)new llvm::FindUsedTypes();
16562c5105adc4f51c6dd07be3471ea2462c8e00c82Reid Spencer      (void)new llvm::ScalarEvolution();
166dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines      ((llvm::Function*)nullptr)->viewCFGOnly();
1670e122d1c2422285c872f68fc0ae1f7e5d2739572Andrew Trick      llvm::RGPassManager RGM;
168dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines      ((llvm::RegionPass*)nullptr)->runOnRegion((llvm::Region*)nullptr, RGM);
169dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines      llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)nullptr);
170dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines      X.add((llvm::Value*)nullptr, 0, nullptr);  // for -print-alias-sets
171b99468d718c4d1b8f20909a4c765e458585ef745Jeff Cohen    }
17213ec702c430b91ee49b9e6d9581cd95412f216c8Jim Laskey  } ForcePassLinking; // Force link by creating a global definition.
173410354fe0c052141dadeca939395743f8dd58e38Chris Lattner}
1744b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen
1754b807e0381be558f3c9173c971ecf640cb9a9176Jeff Cohen#endif
176