summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTim Shen <timshen91@gmail.com>2016-06-08 19:42:32 +0000
committerTim Shen <timshen91@gmail.com>2016-06-08 19:42:32 +0000
commit7aa0ad65ce03b59515fe0089f7cd8250c50cdb25 (patch)
tree1b54b2345e9e2da75ca1767ad6f2c43eb7da100b /llvm/lib
parent916f8a0cdb783d1dfe4dd458bc7cbc3c595037c9 (diff)
downloadbcm5719-llvm-7aa0ad65ce03b59515fe0089f7cd8250c50cdb25.tar.gz
bcm5719-llvm-7aa0ad65ce03b59515fe0089f7cd8250c50cdb25.zip
[MemCpyOpt] Do not exchange llvm.lifetime.start and llvm.memcpy
Reviewers: iteratee Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D21087 llvm-svn: 272192
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index 3c421d2365d..3ab892f7529 100644
--- a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -788,6 +788,11 @@ bool MemCpyOpt::performCallSlotOptzn(Instruction *cpy,
// src only holds uninitialized values at the moment of the call, meaning that
// the memcpy can be discarded rather than moved.
+ // Lifetime marks shouldn't be operated on.
+ if (Function *F = C->getCalledFunction())
+ if (F->isIntrinsic() && F->getIntrinsicID() == Intrinsic::lifetime_start)
+ return false;
+
// Deliberately get the source and destination with bitcasts stripped away,
// because we'll need to do type comparisons based on the underlying type.
CallSite CS(C);
OpenPOWER on IntegriCloud