1 //===-- DCE.h - Functions that perform Dead Code Elimination -----*- C++ -*--=//
3 // This family of functions is useful for performing dead code elimination of
6 //===----------------------------------------------------------------------===//
11 #include "llvm/Module.h"
12 #include "llvm/Method.h"
16 bool DoDeadCodeElimination(Method *M); // DCE a method
17 bool DoDeadCodeElimination(Module *C); // DCE & RUC a whole module
20 // DoADCE - Execute the Agressive Dead Code Elimination Algorithm
22 bool DoADCE(Method *M); // Defined in ADCE.cpp
23 static inline bool DoADCE(Module *M) {
24 return M->reduceApply(DoADCE);
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
34 // WARNING: The entry node of a method may not be simplified.
36 bool SimplifyCFG(Method::iterator &BBIt);
38 } // End namespace opt