1 //===- llvm/Transforms/IPO.h - Interprocedural Transformations --*- C++ -*-===//
3 // This header file defines prototypes for accessor functions that expose passes
4 // in the IPO transformations library.
6 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_TRANSFORMS_IPO_H
9 #define LLVM_TRANSFORMS_IPO_H
14 //===----------------------------------------------------------------------===//
15 // createConstantMergePass - This function returns a new pass that merges
16 // duplicate global constants together into a single constant that is shared.
17 // This is useful because some passes (ie TraceValues) insert a lot of string
18 // constants into the program, regardless of whether or not they duplicate an
21 Pass *createConstantMergePass();
24 //===----------------------------------------------------------------------===//
25 // createDeadTypeEliminationPass - Return a new pass that eliminates symbol
26 // table entries for types that are never used.
28 Pass *createDeadTypeEliminationPass();
31 //===----------------------------------------------------------------------===//
32 // createGlobalDCEPass - This transform is designed to eliminate unreachable
33 // internal globals (functions or global variables)
35 Pass *createGlobalDCEPass();
38 //===----------------------------------------------------------------------===//
39 // createFunctionExtractionPass - This pass deletes as much of the module as
40 // possible, except for the function specified.
42 Pass *createFunctionExtractionPass(Function *F);
45 //===----------------------------------------------------------------------===//
46 // FunctionResolvingPass - Go over the functions that are in the module and
47 // look for functions that have the same name. More often than not, there will
50 // void "foo"(int, int)
51 // because of the way things are declared in C. If this is the case, patch
54 // This is an interprocedural pass.
56 Pass *createFunctionResolvingPass();
59 //===----------------------------------------------------------------------===//
60 // createInternalizePass - This pass loops over all of the functions in the
61 // input module, looking for a main function. If a main function is found, all
62 // other functions are marked as internal.
64 Pass *createInternalizePass();
67 //===----------------------------------------------------------------------===//
68 // createPoolAllocatePass - This transform changes programs so that disjoint
69 // data structures are allocated out of different pools of memory, increasing
70 // locality and shrinking pointer size.
72 Pass *createPoolAllocatePass();
75 //===----------------------------------------------------------------------===//
76 // These passes are wrappers that can do a few simple structure mutation
79 Pass *createSwapElementsPass();
80 Pass *createSortElementsPass();