Use ClonedCodeInfo to avoid another walk over the inlined code, this this
authorChris Lattner <sabre@nondot.org>
Fri, 13 Jan 2006 19:18:11 +0000 (19:18 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 13 Jan 2006 19:18:11 +0000 (19:18 +0000)
time in common C cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25285 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/InlineFunction.cpp

index f7b4ab894a3bf45616ee41583961d7f57258e79b..1b08694ac3617782adafb3a8a0765b9f87234723 100644 (file)
@@ -215,8 +215,10 @@ bool llvm::InlineFunction(CallSite CS) {
         }
   }
 
-  // If we are inlining tail call instruction through an invoke or
-  if (MustClearTailCallFlags) {
+  // If we are inlining tail call instruction through a call site that isn't 
+  // marked 'tail', we must remove the tail marker for any calls in the inlined
+  // code.
+  if (MustClearTailCallFlags && InlinedFunctionInfo.ContainsCalls) {
     for (Function::iterator BB = FirstNewBlock, E = Caller->end();
          BB != E; ++BB)
       for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)