Remove duplicate #include
[oota-llvm.git] / include / llvm / Transforms / Utils / Local.h
1 //===-- Local.h - Functions to perform local transformations -----*- C++ -*--=//
2 //
3 // This family of functions perform various local transformations to the
4 // program.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #ifndef LLVM_TRANSFORMS_UTILS_LOCAL_H
9 #define LLVM_TRANSFORMS_UTILS_LOCAL_H
10
11 #include "llvm/Function.h"
12
13 //===----------------------------------------------------------------------===//
14 //  Local constant propogation...
15 //
16
17 // doConstantPropogation - Constant prop a specific instruction.  Returns true
18 // and potentially moves the iterator if constant propogation was performed.
19 //
20 bool doConstantPropogation(BasicBlock::iterator &I);
21
22 // ConstantFoldTerminator - If a terminator instruction is predicated on a
23 // constant value, convert it into an unconditional branch to the constant
24 // destination.  This is a nontrivial operation because the successors of this
25 // basic block must have their PHI nodes updated.
26 //
27 bool ConstantFoldTerminator(BasicBlock *BB);
28
29
30 //===----------------------------------------------------------------------===//
31 //  Local dead code elimination...
32 //
33
34 // isInstructionTriviallyDead - Return true if the result produced by the
35 // instruction is not used, and the instruction has no side effects.
36 //
37 bool isInstructionTriviallyDead(Instruction *I);
38
39
40 // dceInstruction - Inspect the instruction at *BBI and figure out if it
41 // isTriviallyDead.  If so, remove the instruction and update the iterator to
42 // point to the instruction that immediately succeeded the original instruction.
43 //
44 bool dceInstruction(BasicBlock::iterator &BBI);
45
46
47 //===----------------------------------------------------------------------===//
48 //  Control Flow Graph Restructuring...
49 //
50
51 // SimplifyCFG - This function is used to do simplification of a CFG.  For
52 // example, it adjusts branches to branches to eliminate the extra hop, it
53 // eliminates unreachable basic blocks, and does other "peephole" optimization
54 // of the CFG.  It returns true if a modification was made, possibly deleting
55 // the basic block that was pointed to.
56 //
57 // WARNING:  The entry node of a method may not be simplified.
58 //
59 bool SimplifyCFG(BasicBlock *BB);
60
61 #endif