Constant pools no longer exist
[oota-llvm.git] / include / llvm / Transforms / Scalar / DCE.h
1 //===-- DCE.h - Functions that perform Dead Code Elimination -----*- C++ -*--=//
2 //
3 // This family of functions is useful for performing dead code elimination of 
4 // various sorts.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #ifndef LLVM_OPT_DCE_H
9 #define LLVM_OPT_DCE_H
10
11 #include "llvm/Module.h"
12 #include "llvm/Method.h"
13
14 namespace opt {
15
16 bool DoDeadCodeElimination(Method *M);         // DCE a method
17 bool DoDeadCodeElimination(Module *C);         // DCE & RUC a whole module
18
19
20 // DoADCE - Execute the Agressive Dead Code Elimination Algorithm
21 //
22 bool DoADCE(Method *M);                        // Defined in ADCE.cpp
23 static inline bool DoADCE(Module *M) {
24   return M->reduceApply(DoADCE);
25 }
26
27 // SimplifyCFG - This function is used to do simplification of a CFG.  For
28 // example, it adjusts branches to branches to eliminate the extra hop, it
29 // eliminates unreachable basic blocks, and does other "peephole" optimization
30 // of the CFG.  It returns true if a modification was made, and returns an 
31 // iterator that designates the first element remaining after the block that
32 // was deleted.
33 //
34 // WARNING:  The entry node of a method may not be simplified.
35 //
36 bool SimplifyCFG(Method::iterator &BBIt);
37
38 }  // End namespace opt
39
40 #endif