1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-30 07:22:55 +01:00
llvm-mirror/include/llvm/Transforms/LinkAllPasses.h

116 lines
4.8 KiB
C
Raw Normal View History

2005-01-06 07:29:42 +01:00
//===- llvm/Transforms/LinkAllPasses.h - Reference All Passes ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by Jeff Cohen and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This header file pulls in all transformation passes for tools like opts and
// bugpoint that need this functionality.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TRANSFORMS_LINKALLPASSES_H
#define LLVM_TRANSFORMS_LINKALLPASSES_H
#include "llvm/Analysis/Passes.h"
#include "llvm/Analysis/LoadValueNumbering.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
#include <cstdlib>
namespace {
struct ForcePassLinking {
ForcePassLinking() {
// We must reference the passes in such a way that compilers will not
// delete it all as dead code, even with whole program optimization,
// yet is effectively a NO-OP. As the compiler isn't smart enough
// to know that getenv() never returns -1, this will do the job.
if (std::getenv("bar") != (char*) -1)
return;
(void) llvm::createAAEvalPass();
(void) llvm::createAggressiveDCEPass();
(void) llvm::createAliasAnalysisCounterPass();
(void) llvm::createAndersensPass();
(void) llvm::createArgumentPromotionPass();
(void) llvm::createBasicAliasAnalysisPass();
(void) llvm::createBasicVNPass();
(void) llvm::createBlockPlacementPass();
(void) llvm::createBlockProfilerPass();
(void) llvm::createBreakCriticalEdgesPass();
(void) llvm::createCFGSimplificationPass();
(void) llvm::createConstantMergePass();
(void) llvm::createConstantPropagationPass();
(void) llvm::createCorrelatedExpressionEliminationPass();
(void) llvm::createDSAAPass();
(void) llvm::createDSOptPass();
(void) llvm::createDeadArgEliminationPass();
(void) llvm::createDeadCodeEliminationPass();
(void) llvm::createDeadInstEliminationPass();
(void) llvm::createDeadStoreEliminationPass();
(void) llvm::createDeadTypeEliminationPass();
(void) llvm::createEdgeProfilerPass();
(void) llvm::createEmitFunctionTablePass();
(void) llvm::createFunctionInliningPass();
(void) llvm::createFunctionProfilerPass();
(void) llvm::createFunctionResolvingPass();
(void) llvm::createGCSEPass();
(void) llvm::createGlobalDCEPass();
(void) llvm::createGlobalOptimizerPass();
(void) llvm::createGlobalsModRefPass();
(void) llvm::createIPConstantPropagationPass();
(void) llvm::createIPSCCPPass();
(void) llvm::createIndVarSimplifyPass();
(void) llvm::createInstructionCombiningPass();
(void) llvm::createInternalizePass(false);
(void) llvm::createLICMPass();
(void) llvm::createLoadValueNumberingPass();
(void) llvm::createLoopExtractorPass();
(void) llvm::createLoopSimplifyPass();
(void) llvm::createLoopStrengthReducePass();
(void) llvm::createLoopUnrollPass();
(void) llvm::createLoopUnswitchPass();
(void) llvm::createLowerAllocationsPass();
(void) llvm::createLowerGCPass();
(void) llvm::createLowerInvokePass();
(void) llvm::createLowerPackedPass();
(void) llvm::createLowerSelectPass();
(void) llvm::createLowerSetJmpPass();
(void) llvm::createLowerSwitchPass();
(void) llvm::createNoAAPass();
(void) llvm::createNoProfileInfoPass();
(void) llvm::createProfileLoaderPass();
(void) llvm::createPromoteMemoryToRegisterPass();
(void) llvm::createDemoteRegisterToMemoryPass();
(void) llvm::createPruneEHPass();
(void) llvm::createRaiseAllocationsPass();
(void) llvm::createRaisePointerReferencesPass();
(void) llvm::createReassociatePass();
(void) llvm::createSCCPPass();
(void) llvm::createScalarReplAggregatesPass();
(void) llvm::createSimplifyLibCallsPass();
(void) llvm::createSingleLoopExtractorPass();
(void) llvm::createSteensgaardPass();
(void) llvm::createStripSymbolsPass();
(void) llvm::createTailCallEliminationPass();
(void) llvm::createTailDuplicationPass();
(void) llvm::createTraceBasicBlockPass();
(void) llvm::createTraceValuesPassForBasicBlocks();
(void) llvm::createTraceValuesPassForFunction();
(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();
}
} ForcePassLinking;
}
#endif