summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-04-01 02:51:26 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-04-01 02:51:26 +0000
commit18b92968eabd0c3c79417e29d97e9ab502143ed3 (patch)
tree3178d09354a7505ce3f8ddb479d25ec950e97b2d /llvm/lib/Transforms
parent9d41a8f269a284cf1b08c0cd37d3c38be6f0d2a2 (diff)
downloadbcm5719-llvm-18b92968eabd0c3c79417e29d97e9ab502143ed3.tar.gz
bcm5719-llvm-18b92968eabd0c3c79417e29d97e9ab502143ed3.zip
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')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 50eff521318..42179851718 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);
}
}
OpenPOWER on IntegriCloud