Use ClonedCodeInfo to avoid another walk over the inlined code, this this
time in common C cases.
llvm-svn: 25285
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index f7b4ab8..1b08694 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -215,8 +215,10 @@
}
}
- // 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)