From: Reid Kleckner Date: Thu, 15 May 2014 20:39:42 +0000 (+0000) Subject: Remove unused variable in inliner X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=a9bef412755f772b5a523f31f3c81e8a9a61eeca Remove unused variable in inliner We have to iterate over all the calls that were inlined to find out if any were musttail. Sink another variable down to where its used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208913 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index 5b7a5dc88d7..e01d0c38ec4 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/lib/Transforms/Utils/InlineFunction.cpp @@ -529,13 +529,6 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI, CalledFunc->isDeclaration() || // call, or call to a vararg function! CalledFunc->getFunctionType()->isVarArg()) return false; - // If the call to the callee is not a tail call, we must clear the 'tail' - // flags on any calls that we inline. - CallInst::TailCallKind CallSiteTailKind = CallInst::TCK_None; - if (CallInst *CI = dyn_cast(TheCall)) - CallSiteTailKind = CI->getTailCallKind(); - bool MustClearTailCallFlags = false; - // If the call to the callee cannot throw, set the 'nounwind' flag on any // calls that we inline. bool MarkNoUnwind = CS.doesNotThrow(); @@ -693,6 +686,10 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI, bool InlinedMustTailCalls = false; if (InlinedFunctionInfo.ContainsCalls) { + CallInst::TailCallKind CallSiteTailKind = CallInst::TCK_None; + if (CallInst *CI = dyn_cast(TheCall)) + CallSiteTailKind = CI->getTailCallKind(); + for (Function::iterator BB = FirstNewBlock, E = Caller->end(); BB != E; ++BB) { for (Instruction &I : *BB) {