Add a workaround for PR962, disabling the more aggressive form of this
authorChris Lattner <sabre@nondot.org>
Sun, 22 Oct 2006 18:42:26 +0000 (18:42 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 22 Oct 2006 18:42:26 +0000 (18:42 +0000)
transformation.  This speeds up a C++ app 2.25x.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31113 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/TailRecursionElimination.cpp

index 5b46007e42b272c83ca17ed3d7e7426f0914fda6..14c4d8bdc7478593473ee3ec092cd30d6e9d48bd 100644 (file)
@@ -140,6 +140,14 @@ bool TailCallElim::runOnFunction(Function &F) {
     FunctionContainsEscapingAllocas |=
       CheckForEscapingAllocas(BB, CannotTCETailMarkedCall);
   }
+  
+  /// FIXME: The code generator produces really bad code when an 'escaping
+  /// alloca' is changed from being a static alloca to being a dynamic alloca.
+  /// Until this is resolved, disable this transformation if that would ever
+  /// happen.  This bug is PR962.
+  if (FunctionContainsEscapingAllocas)
+    return false;
+  
 
   // Second pass, change any tail calls to loops.
   for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)