2006-08-21 07:37:03 +02:00
|
|
|
//===- llvm/LinkAllPasses.h ------------ Reference All Passes ---*- C++ -*-===//
|
2005-04-21 22:59:05 +02:00
|
|
|
//
|
2005-01-07 08:46:40 +01:00
|
|
|
// The LLVM Compiler Infrastructure
|
2005-01-06 07:02:53 +01:00
|
|
|
//
|
2007-12-29 20:59:42 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 22:59:05 +02:00
|
|
|
//
|
2005-01-06 07:02:53 +01:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2006-08-21 07:37:03 +02:00
|
|
|
// This header file pulls in all transformation and analysis passes for tools
|
|
|
|
// like opt and bugpoint that need this functionality.
|
2005-01-06 07:02:53 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2006-08-21 07:34:03 +02:00
|
|
|
#ifndef LLVM_LINKALLPASSES_H
|
|
|
|
#define LLVM_LINKALLPASSES_H
|
2005-01-06 07:02:53 +01:00
|
|
|
|
2006-08-21 07:34:03 +02:00
|
|
|
#include "llvm/Analysis/AliasSetTracker.h"
|
|
|
|
#include "llvm/Analysis/FindUsedTypes.h"
|
|
|
|
#include "llvm/Analysis/IntervalPartition.h"
|
2008-06-30 02:04:21 +02:00
|
|
|
#include "llvm/Analysis/LoopVR.h"
|
2006-08-21 07:34:03 +02:00
|
|
|
#include "llvm/Analysis/Passes.h"
|
2009-07-14 20:44:28 +02:00
|
|
|
#include "llvm/Analysis/PointerTracking.h"
|
2006-08-21 07:34:03 +02:00
|
|
|
#include "llvm/Analysis/PostDominators.h"
|
|
|
|
#include "llvm/Analysis/ScalarEvolution.h"
|
2008-10-22 01:33:38 +02:00
|
|
|
#include "llvm/Assembly/PrintModulePass.h"
|
2005-01-08 19:15:23 +01:00
|
|
|
#include "llvm/CodeGen/Passes.h"
|
2006-08-21 07:34:03 +02:00
|
|
|
#include "llvm/Function.h"
|
2005-01-06 07:02:53 +01:00
|
|
|
#include "llvm/Transforms/Instrumentation.h"
|
|
|
|
#include "llvm/Transforms/IPO.h"
|
|
|
|
#include "llvm/Transforms/Scalar.h"
|
|
|
|
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
|
2005-10-24 02:08:51 +02:00
|
|
|
#include <cstdlib>
|
2005-01-06 07:02:53 +01:00
|
|
|
|
|
|
|
namespace {
|
2005-01-08 23:01:16 +01:00
|
|
|
struct ForcePassLinking {
|
|
|
|
ForcePassLinking() {
|
2005-10-24 02:08:51 +02:00
|
|
|
// We must reference the passes in such a way that compilers will not
|
2005-01-07 08:44:02 +01:00
|
|
|
// delete it all as dead code, even with whole program optimization,
|
|
|
|
// yet is effectively a NO-OP. As the compiler isn't smart enough
|
2005-10-24 02:08:51 +02:00
|
|
|
// to know that getenv() never returns -1, this will do the job.
|
|
|
|
if (std::getenv("bar") != (char*) -1)
|
2005-01-07 08:44:02 +01:00
|
|
|
return;
|
2005-01-06 07:02:53 +01:00
|
|
|
|
2005-01-08 23:01:16 +01:00
|
|
|
(void) llvm::createAAEvalPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createAggressiveDCEPass();
|
2005-01-08 23:01:16 +01:00
|
|
|
(void) llvm::createAliasAnalysisCounterPass();
|
2006-11-14 06:21:04 +01:00
|
|
|
(void) llvm::createAliasDebugger();
|
2005-01-08 23:01:16 +01:00
|
|
|
(void) llvm::createAndersensPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createArgumentPromotionPass();
|
2008-03-07 22:07:34 +01:00
|
|
|
(void) llvm::createStructRetPromotionPass();
|
2005-01-08 23:01:16 +01:00
|
|
|
(void) llvm::createBasicAliasAnalysisPass();
|
2008-05-07 21:53:05 +02:00
|
|
|
(void) llvm::createLibCallAliasAnalysisPass(0);
|
2005-01-08 18:21:40 +01:00
|
|
|
(void) llvm::createBlockPlacementPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createBlockProfilerPass();
|
|
|
|
(void) llvm::createBreakCriticalEdgesPass();
|
|
|
|
(void) llvm::createCFGSimplificationPass();
|
|
|
|
(void) llvm::createConstantMergePass();
|
|
|
|
(void) llvm::createConstantPropagationPass();
|
|
|
|
(void) llvm::createDeadArgEliminationPass();
|
|
|
|
(void) llvm::createDeadCodeEliminationPass();
|
|
|
|
(void) llvm::createDeadInstEliminationPass();
|
|
|
|
(void) llvm::createDeadStoreEliminationPass();
|
|
|
|
(void) llvm::createDeadTypeEliminationPass();
|
|
|
|
(void) llvm::createEdgeProfilerPass();
|
|
|
|
(void) llvm::createFunctionInliningPass();
|
2008-09-03 22:24:05 +02:00
|
|
|
(void) llvm::createAlwaysInlinerPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createFunctionProfilerPass();
|
|
|
|
(void) llvm::createGlobalDCEPass();
|
|
|
|
(void) llvm::createGlobalOptimizerPass();
|
2005-01-08 19:15:23 +01:00
|
|
|
(void) llvm::createGlobalsModRefPass();
|
2007-05-30 01:36:32 +02:00
|
|
|
(void) llvm::createGVNPREPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createIPConstantPropagationPass();
|
|
|
|
(void) llvm::createIPSCCPPass();
|
|
|
|
(void) llvm::createIndVarSimplifyPass();
|
|
|
|
(void) llvm::createInstructionCombiningPass();
|
2005-10-19 03:41:47 +02:00
|
|
|
(void) llvm::createInternalizePass(false);
|
2006-05-26 15:58:26 +02:00
|
|
|
(void) llvm::createLCSSAPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createLICMPass();
|
2009-03-19 18:29:04 +01:00
|
|
|
(void) llvm::createLiveValuesPass();
|
2009-06-24 23:29:13 +02:00
|
|
|
(void) llvm::createLoopDependenceAnalysisPass();
|
2005-01-08 18:21:40 +01:00
|
|
|
(void) llvm::createLoopExtractorPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createLoopSimplifyPass();
|
|
|
|
(void) llvm::createLoopStrengthReducePass();
|
|
|
|
(void) llvm::createLoopUnrollPass();
|
|
|
|
(void) llvm::createLoopUnswitchPass();
|
2007-04-07 06:43:02 +02:00
|
|
|
(void) llvm::createLoopRotatePass();
|
2007-08-07 02:25:56 +02:00
|
|
|
(void) llvm::createLoopIndexSplitPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createLowerAllocationsPass();
|
|
|
|
(void) llvm::createLowerInvokePass();
|
|
|
|
(void) llvm::createLowerSetJmpPass();
|
|
|
|
(void) llvm::createLowerSwitchPass();
|
2005-01-08 23:01:16 +01:00
|
|
|
(void) llvm::createNoAAPass();
|
|
|
|
(void) llvm::createNoProfileInfoPass();
|
2005-01-10 04:56:27 +01:00
|
|
|
(void) llvm::createProfileLoaderPass();
|
2005-03-28 04:52:28 +02:00
|
|
|
(void) llvm::createPromoteMemoryToRegisterPass();
|
2005-11-10 03:07:45 +01:00
|
|
|
(void) llvm::createDemoteRegisterToMemoryPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createPruneEHPass();
|
|
|
|
(void) llvm::createRaiseAllocationsPass();
|
|
|
|
(void) llvm::createReassociatePass();
|
|
|
|
(void) llvm::createSCCPPass();
|
|
|
|
(void) llvm::createScalarReplAggregatesPass();
|
2005-04-26 04:57:49 +02:00
|
|
|
(void) llvm::createSimplifyLibCallsPass();
|
2008-11-05 00:41:45 +01:00
|
|
|
(void) llvm::createSimplifyHalfPowrLibCallsPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createSingleLoopExtractorPass();
|
2005-01-08 18:21:40 +01:00
|
|
|
(void) llvm::createStripSymbolsPass();
|
2008-11-18 22:34:39 +01:00
|
|
|
(void) llvm::createStripNonDebugSymbolsPass();
|
2008-02-22 19:39:29 +01:00
|
|
|
(void) llvm::createStripDeadPrototypesPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createTailCallEliminationPass();
|
|
|
|
(void) llvm::createTailDuplicationPass();
|
2008-04-20 22:35:01 +02:00
|
|
|
(void) llvm::createJumpThreadingPass();
|
2005-01-08 18:21:40 +01:00
|
|
|
(void) llvm::createUnifyFunctionExitNodesPass();
|
2005-04-15 23:13:16 +02:00
|
|
|
(void) llvm::createCondPropagationPass();
|
Random sampling (aka Arnold and Ryder) profiling. This is still preliminary, but it works on spec on x86 and alpha. The idea is to allow profiling passes to remember what profiling they inserted, then a random sampling framework is inserted which consists of duplicated basic blocks (without profiling), such that at each backedge in the program and entry into every function, the framework chooses whether to use the instrumented code or the instrumentation free code. The goal of such a framework is to make it reasonably cheap to do random sampling of very expensive profiling products (such as load-value profiling).
The code is organized into 3 parts (2 passes)
1) a linked set of profiling passes, which implement an analysis group (linked, like alias analysis are). These insert profiling into the program, and remember what they inserted, so that at a later time they can be queried about any instruction.
2) a pass that handles inserting the random sampling framework. This also has options to control how random samples are choosen. Currently implemented are Global counters, register allocated global counters, and read cycle counter (see? there was a reason for it).
The profiling passes are almost identical to the existing ones (block, function, and null profiling is supported right now), and they are valid passes without the sampling framework (hence the existing passes can be unified with the new ones, not done yet).
Some things are a bit ugly still, but that should be fixed up soon enough.
Other todo? making the counter values not "magic 2^16 -1" values, but dynamically choosable.
llvm-svn: 24493
2005-11-28 01:58:09 +01:00
|
|
|
(void) llvm::createNullProfilerRSPass();
|
|
|
|
(void) llvm::createRSProfilingPass();
|
2006-04-10 21:26:09 +02:00
|
|
|
(void) llvm::createIndMemRemPass();
|
2006-08-21 07:34:03 +02:00
|
|
|
(void) llvm::createInstCountPass();
|
2006-08-29 00:44:55 +02:00
|
|
|
(void) llvm::createPredicateSimplifierPass();
|
2007-03-31 06:06:36 +02:00
|
|
|
(void) llvm::createCodeGenPreparePass();
|
2007-07-24 19:55:58 +02:00
|
|
|
(void) llvm::createGVNPass();
|
2008-04-09 10:23:16 +02:00
|
|
|
(void) llvm::createMemCpyOptPass();
|
2008-04-29 22:06:54 +02:00
|
|
|
(void) llvm::createLoopDeletionPass();
|
2008-05-29 19:00:13 +02:00
|
|
|
(void) llvm::createPostDomTree();
|
|
|
|
(void) llvm::createPostDomFrontier();
|
2008-08-23 08:07:02 +02:00
|
|
|
(void) llvm::createInstructionNamerPass();
|
2008-09-03 23:00:28 +02:00
|
|
|
(void) llvm::createPartialSpecializationPass();
|
2008-12-31 17:14:43 +01:00
|
|
|
(void) llvm::createFunctionAttrsPass();
|
2008-11-02 06:52:50 +01:00
|
|
|
(void) llvm::createMergeFunctionsPass();
|
2008-10-22 01:33:38 +02:00
|
|
|
(void) llvm::createPrintModulePass(0);
|
|
|
|
(void) llvm::createPrintFunctionPass("", 0);
|
2008-12-16 10:09:19 +01:00
|
|
|
(void) llvm::createDbgInfoPrinterPass();
|
2009-06-14 10:26:32 +02:00
|
|
|
(void) llvm::createPartialInliningPass();
|
2009-07-03 21:28:36 +02:00
|
|
|
(void) llvm::createSSIPass();
|
2009-07-09 17:33:55 +02:00
|
|
|
(void) llvm::createSSIEverythingPass();
|
2006-08-21 07:34:03 +02:00
|
|
|
|
|
|
|
(void)new llvm::IntervalPartition();
|
|
|
|
(void)new llvm::FindUsedTypes();
|
|
|
|
(void)new llvm::ScalarEvolution();
|
2008-06-30 02:04:21 +02:00
|
|
|
(void)new llvm::LoopVR();
|
2009-07-14 20:44:28 +02:00
|
|
|
(void)new llvm::PointerTracking();
|
2006-08-21 07:34:03 +02:00
|
|
|
((llvm::Function*)0)->viewCFGOnly();
|
|
|
|
llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0);
|
|
|
|
X.add((llvm::Value*)0, 0); // for -print-alias-sets
|
2005-01-07 08:44:02 +01:00
|
|
|
}
|
2006-08-01 16:21:23 +02:00
|
|
|
} ForcePassLinking; // Force link by creating a global definition.
|
2006-02-22 17:23:43 +01:00
|
|
|
}
|
2005-01-06 07:02:53 +01:00
|
|
|
|
|
|
|
#endif
|