diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-02-25 02:56:01 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-02-25 02:56:01 +0000 |
commit | 07d37bc1edafcf53ffc334ec0a35236e636471dc (patch) | |
tree | 5ff186f59df288bf889f230898f6c942cc3c7910 /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | 2495ab08fc79d42a3a7ee0200b6592cb80501056 (diff) | |
download | bcm5719-llvm-07d37bc1edafcf53ffc334ec0a35236e636471dc.tar.gz bcm5719-llvm-07d37bc1edafcf53ffc334ec0a35236e636471dc.zip |
Add support for disabling llvm.lifetime intrinsics in the AlwaysInliner. These
are optimization hints, but at -O0 we're not optimizing. This becomes a problem
when the alwaysinline attribute is abused.
rdar://10921594
llvm-svn: 151429
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index fad56751b85..b84de054132 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -31,11 +31,11 @@ #include "llvm/Support/IRBuilder.h" using namespace llvm; -bool llvm::InlineFunction(CallInst *CI, InlineFunctionInfo &IFI) { - return InlineFunction(CallSite(CI), IFI); +bool llvm::InlineFunction(CallInst *CI, InlineFunctionInfo &IFI, bool InsertLifetime) { + return InlineFunction(CallSite(CI), IFI, InsertLifetime); } -bool llvm::InlineFunction(InvokeInst *II, InlineFunctionInfo &IFI) { - return InlineFunction(CallSite(II), IFI); +bool llvm::InlineFunction(InvokeInst *II, InlineFunctionInfo &IFI, bool InsertLifetime) { + return InlineFunction(CallSite(II), IFI, InsertLifetime); } namespace { @@ -484,7 +484,7 @@ static void fixupLineNumbers(Function *Fn, Function::iterator FI, /// instruction 'call B' is inlined, and 'B' calls 'C', then the call to 'C' now /// exists in the instruction stream. Similarly this will inline a recursive /// function by one level. -bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI) { +bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI, bool InsertLifetime) { Instruction *TheCall = CS.getInstruction(); assert(TheCall->getParent() && TheCall->getParent()->getParent() && "Instruction not in function!"); @@ -655,7 +655,7 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI) { // Leave lifetime markers for the static alloca's, scoping them to the // function we just inlined. - if (!IFI.StaticAllocas.empty()) { + if (InsertLifetime && !IFI.StaticAllocas.empty()) { IRBuilder<> builder(FirstNewBlock->begin()); for (unsigned ai = 0, ae = IFI.StaticAllocas.size(); ai != ae; ++ai) { AllocaInst *AI = IFI.StaticAllocas[ai]; |