1 //===-- Scalar.h - Scalar Transformations ------------------------*- C++ -*-==//
3 // This header file defines prototypes for accessor functions that expose passes
4 // in the Scalar transformations library.
6 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_TRANSFORMS_SCALAR_H
9 #define LLVM_TRANSFORMS_SCALAR_H
13 //===----------------------------------------------------------------------===//
15 // Constant Propogation Pass - A worklist driven constant propogation pass
17 Pass *createConstantPropogationPass();
20 //===----------------------------------------------------------------------===//
22 // Sparse Conditional Constant Propogation Pass
24 Pass *createSCCPPass();
27 //===----------------------------------------------------------------------===//
29 // DeadInstElimination - This pass quickly removes trivially dead instructions
30 // without modifying the CFG of the function. It is a BasicBlockPass, so it
31 // runs efficiently when queued next to other BasicBlockPass's.
33 Pass *createDeadInstEliminationPass();
36 //===----------------------------------------------------------------------===//
38 // DeadCodeElimination - This pass is more powerful than DeadInstElimination,
39 // because it is worklist driven that can potentially revisit instructions when
40 // their other instructions become dead, to eliminate chains of dead
43 Pass *createDeadCodeEliminationPass();
46 //===----------------------------------------------------------------------===//
48 // AgressiveDCE - This pass uses the SSA based Agressive DCE algorithm. This
49 // algorithm assumes instructions are dead until proven otherwise, which makes
50 // it more successful are removing non-obviously dead instructions.
52 Pass *createAgressiveDCEPass();
55 //===----------------------------------------------------------------------===//
57 // DecomposeMultiDimRefs - Convert multi-dimensional references consisting of
58 // any combination of 2 or more array and structure indices into a sequence of
59 // instructions (using getelementpr and cast) so that each instruction has at
60 // most one index (except structure references, which need an extra leading
63 Pass *createDecomposeMultiDimRefsPass();
66 //===----------------------------------------------------------------------===//
68 // GCSE - This pass is designed to be a very quick global transformation that
69 // eliminates global common subexpressions from a function. It does this by
70 // examining the SSA value graph of the function, instead of doing slow
71 // bit-vector computations.
73 Pass *createGCSEPass();
76 //===----------------------------------------------------------------------===//
78 // InductionVariableSimplify - Transform induction variables in a program to all
79 // use a single cannonical induction variable per loop.
81 Pass *createIndVarSimplifyPass();
84 //===----------------------------------------------------------------------===//
86 // InstructionCombining - Combine instructions to form fewer, simple
87 // instructions. This pass does not modify the CFG, and has a tendancy to
88 // make instructions dead, so a subsequent DCE pass is useful.
90 // This pass combines things like:
96 Pass *createInstructionCombiningPass();
99 //===----------------------------------------------------------------------===//
101 // This pass is used to promote memory references to be register references. A
102 // simple example of the transformation performed by this pass is:
105 // %X = alloca int, uint 1 ret int 42
106 // store int 42, int *%X
110 Pass *createPromoteMemoryToRegister();
113 //===----------------------------------------------------------------------===//
115 // These functions removes symbols from functions and modules.
117 Pass *createSymbolStrippingPass();
118 Pass *createFullSymbolStrippingPass();