From 250eff20dab7763a94c263972faef876d6965599 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 22 Oct 2006 18:42:26 +0000 Subject: [PATCH] Add a workaround for PR962, disabling the more aggressive form of this transformation. This speeds up a C++ app 2.25x. llvm-svn: 31113 --- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp index 5b46007e42b2..14c4d8bdc747 100644 --- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp +++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp @@ -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) -- GitLab