diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-04-01 02:51:26 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-04-01 02:51:26 +0000 |
commit | 18b92968eabd0c3c79417e29d97e9ab502143ed3 (patch) | |
tree | 3178d09354a7505ce3f8ddb479d25ec950e97b2d /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | 9d41a8f269a284cf1b08c0cd37d3c38be6f0d2a2 (diff) | |
download | llvm-18b92968eabd0c3c79417e29d97e9ab502143ed3.zip llvm-18b92968eabd0c3c79417e29d97e9ab502143ed3.tar.gz llvm-18b92968eabd0c3c79417e29d97e9ab502143ed3.tar.bz2 |
Don't insert lifetime end markers on deoptimizing returns
They're not necessary (since the lifetime of the alloca is trivially
over due to the return), and the way LLVM inserts the lifetime.end
markers breaks the IR (we get a lifetime end marker between the
deoptimize call and the return).
llvm-svn: 265100
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 50eff52..4217985 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -1703,11 +1703,14 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI, builder.CreateLifetimeStart(AI, AllocaSize); for (ReturnInst *RI : Returns) { - // Don't insert llvm.lifetime.end calls between a musttail call and a - // return. The return kills all local allocas. + // Don't insert llvm.lifetime.end calls between a musttail or deoptimize + // call and a return. The return kills all local allocas. if (InlinedMustTailCalls && RI->getParent()->getTerminatingMustTailCall()) continue; + if (InlinedDeoptimizeCalls && + RI->getParent()->getTerminatingDeoptimizeCall()) + continue; IRBuilder<>(RI).CreateLifetimeEnd(AI, AllocaSize); } } |