Expose the TCE pass
authorChris Lattner <sabre@nondot.org>
Sat, 20 Sep 2003 05:14:13 +0000 (05:14 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 20 Sep 2003 05:14:13 +0000 (05:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8619 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Scalar.h
lib/Transforms/Scalar/TailRecursionElimination.cpp

index b240f58dc83cddc1dc0ace1638dcf5c58ea12a97..796d57b578a5908f7340aba7caf787a1deea49c9 100644 (file)
@@ -241,6 +241,13 @@ void SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P = 0);
 Pass *createLoopPreheaderInsertionPass();
 extern const PassInfo *LoopPreheadersID;
 
+//===----------------------------------------------------------------------===//
+// 
+// This pass eliminates call instructions to the current function which occur
+// immediately before return instructions.
+//
+FunctionPass *createTailCallEliminationPass();
+
 
 //===----------------------------------------------------------------------===//
 // This pass convert malloc and free instructions to %malloc & %free function
index f0c5ba73b917f4bca185133131e3746b73849f4e..3945af3db75c6aa55b872e1fa2061b15ce5241cc 100644 (file)
@@ -19,6 +19,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/Transforms/Scalar.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Function.h"
 #include "llvm/Instructions.h"
@@ -34,6 +35,8 @@ namespace {
   RegisterOpt<TailCallElim> X("tailcallelim", "Tail Call Elimination");
 }
 
+FunctionPass *createTailCallEliminationPass() { return new TailCallElim(); }
+
 
 bool TailCallElim::runOnFunction(Function &F) {
   // If this function is a varargs function, we won't be able to PHI the args