[llvm] r208913 - Remove unused variable in inliner

Reid Kleckner reid at kleckner.net
Thu May 15 13:39:42 PDT 2014


Author: rnk
Date: Thu May 15 15:39:42 2014
New Revision: 208913

URL: http://llvm.org/viewvc/llvm-project?rev=208913&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp

Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=208913&r1=208912&r2=208913&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Thu May 15 15:39:42 2014
@@ -529,13 +529,6 @@ bool llvm::InlineFunction(CallSite CS, I
       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<CallInst>(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, I
 
   bool InlinedMustTailCalls = false;
   if (InlinedFunctionInfo.ContainsCalls) {
+    CallInst::TailCallKind CallSiteTailKind = CallInst::TCK_None;
+    if (CallInst *CI = dyn_cast<CallInst>(TheCall))
+      CallSiteTailKind = CI->getTailCallKind();
+
     for (Function::iterator BB = FirstNewBlock, E = Caller->end(); BB != E;
          ++BB) {
       for (Instruction &I : *BB) {





More information about the llvm-commits mailing list