summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-11-05 08:21:11 +0000
committerChris Lattner <sabre@nondot.org>2005-11-05 08:21:11 +0000
commit16b29e95626ffc03eca49c24c6280893c9d00640 (patch)
tree4d31bdaae1f40778a668ed79675a492942811966 /llvm/lib/Transforms
parent7a4c694ef7067e68d307b057901fccdf1aa265f6 (diff)
downloadbcm5719-llvm-16b29e95626ffc03eca49c24c6280893c9d00640.tar.gz
bcm5719-llvm-16b29e95626ffc03eca49c24c6280893c9d00640.zip
Implement Transforms/TailCallElim/return-undef.ll, a trivial case
that has been sitting in my inbox since May 18. :) llvm-svn: 24194
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
index a8c2a3a8b77..99c1f10865b 100644
--- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -342,6 +342,7 @@ bool TailCallElim::ProcessReturningBlock(ReturnInst *Ret, BasicBlock *&OldEntry,
// constant, return the value returned by the tail call, or that are being
// accumulator recursion variable eliminated.
if (Ret->getNumOperands() != 0 && Ret->getReturnValue() != CI &&
+ !isa<UndefValue>(Ret->getReturnValue()) &&
AccumulatorRecursionEliminationInitVal == 0 &&
!getCommonReturnValue(Ret, CI))
return false;
OpenPOWER on IntegriCloud