Added prototype for ConstantFoldTerminator
authorChris Lattner <sabre@nondot.org>
Fri, 29 Jun 2001 23:56:00 +0000 (23:56 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 29 Jun 2001 23:56:00 +0000 (23:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Optimizations/AllOpts.h

index c68ebc48c5aa2723d5cb24e73234afaac67a5885..1035b209640270164cc0de352138322bc8641cc7 100644 (file)
@@ -15,6 +15,7 @@
 #include "llvm/Tools/STLExtras.h"
 class Method;
 class CallInst;
+class TerminatorInst;
 
 //===----------------------------------------------------------------------===//
 // Helper functions
@@ -24,6 +25,7 @@ static inline bool ApplyOptToAllMethods(Module *C, bool (*Opt)(Method*)) {
   return reduce_apply_bool(C->begin(), C->end(), ptr_fun(Opt));
 }
 
+
 //===----------------------------------------------------------------------===//
 // Dead Code Elimination Pass
 //
@@ -32,6 +34,7 @@ bool DoDeadCodeElimination(Method *M);         // DCE a method
 bool DoRemoveUnusedConstants(SymTabValue *S);  // RUC a method or module
 bool DoDeadCodeElimination(Module *C);         // DCE & RUC a whole module
 
+
 //===----------------------------------------------------------------------===//
 // Constant Propogation Pass
 //
@@ -42,6 +45,13 @@ static inline bool DoConstantPropogation(Module *C) {
   return ApplyOptToAllMethods(C, DoConstantPropogation); 
 }
 
+// ConstantFoldTerminator - If a terminator instruction is predicated on a
+// constant value, convert it into an unconditional branch to the constant
+// destination.
+//
+bool ConstantFoldTerminator(TerminatorInst *T);
+
+
 //===----------------------------------------------------------------------===//
 // Constant Pool Merging Pass
 //
@@ -72,6 +82,7 @@ template <class Unit> bool DoSCCP(Unit *M) {
   return DoSparseConditionalConstantProp(M); 
 }
 
+
 //===----------------------------------------------------------------------===//
 // Method Inlining Pass
 //