Implement Transforms/TailCallElim/return-undef.ll, a trivial case

that has been sitting in my inbox since May 18. :)

llvm-svn: 24194
This commit is contained in:
Chris Lattner 2005-11-05 08:21:11 +00:00
parent 7a4c694ef7
commit 16b29e9562
1 changed files with 1 additions and 0 deletions

View File

@ -342,6 +342,7 @@ bool TailCallElim::ProcessReturningBlock(ReturnInst *Ret, BasicBlock *&OldEntry,
// constant, return the value returned by the tail call, or that are being // constant, return the value returned by the tail call, or that are being
// accumulator recursion variable eliminated. // accumulator recursion variable eliminated.
if (Ret->getNumOperands() != 0 && Ret->getReturnValue() != CI && if (Ret->getNumOperands() != 0 && Ret->getReturnValue() != CI &&
!isa<UndefValue>(Ret->getReturnValue()) &&
AccumulatorRecursionEliminationInitVal == 0 && AccumulatorRecursionEliminationInitVal == 0 &&
!getCommonReturnValue(Ret, CI)) !getCommonReturnValue(Ret, CI))
return false; return false;