From: Cameron Zwarich Date: Thu, 24 Mar 2011 15:54:11 +0000 (+0000) Subject: It is enough for the CallInst to have no uses to be made a tail call with a ret X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=dc31cfeb74c46fe564a350ffd20880e61d04f286;p=oota-llvm.git It is enough for the CallInst to have no uses to be made a tail call with a ret void; it doesn't need to have a void type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128212 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index fc7e13675cb..337a4d3c468 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -644,7 +644,7 @@ bool CodeGenPrepare::DupRetToEnableTailCallOpts(ReturnInst *RI) { if (++RI == RE) continue; CallInst *CI = dyn_cast(&*RI); - if (CI && CI->getType()->isVoidTy() && TLI->mayBeEmittedAsTailCall(CI)) + if (CI && CI->use_empty() && TLI->mayBeEmittedAsTailCall(CI)) TailCalls.push_back(CI); } }