diff options
| author | Tim Shen <timshen91@gmail.com> | 2016-06-08 19:42:32 +0000 |
|---|---|---|
| committer | Tim Shen <timshen91@gmail.com> | 2016-06-08 19:42:32 +0000 |
| commit | 7aa0ad65ce03b59515fe0089f7cd8250c50cdb25 (patch) | |
| tree | 1b54b2345e9e2da75ca1767ad6f2c43eb7da100b /llvm/test/Transforms/MemCpyOpt | |
| parent | 916f8a0cdb783d1dfe4dd458bc7cbc3c595037c9 (diff) | |
| download | bcm5719-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/test/Transforms/MemCpyOpt')
| -rw-r--r-- | llvm/test/Transforms/MemCpyOpt/lifetime.ll | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/Transforms/MemCpyOpt/lifetime.ll b/llvm/test/Transforms/MemCpyOpt/lifetime.ll new file mode 100644 index 00000000000..6a7e44692da --- /dev/null +++ b/llvm/test/Transforms/MemCpyOpt/lifetime.ll @@ -0,0 +1,25 @@ +; RUN: opt < %s -O1 -S | FileCheck %s + +; performCallSlotOptzn in MemCpy should not exchange the calls to +; @llvm.lifetime.start and @llvm.memcpy. + +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #1 +declare void @llvm.lifetime.start(i64, i8* nocapture) #1 +declare void @llvm.lifetime.end(i64, i8* nocapture) #1 + +define void @_ZN4CordC2EOS_(i8* nocapture dereferenceable(16) %arg1) { +bb: +; CHECK-LABEL: @_ZN4CordC2EOS_ +; CHECK-NOT: call void @llvm.lifetime.start +; CHECK: ret void + %tmp = alloca [8 x i8], align 8 + %tmp5 = bitcast [8 x i8]* %tmp to i8* + call void @llvm.lifetime.start(i64 16, i8* %tmp5) + %tmp10 = getelementptr inbounds i8, i8* %tmp5, i64 7 + store i8 0, i8* %tmp10, align 1 + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %arg1, i8* %tmp5, i64 16, i32 8, i1 false) + call void @llvm.lifetime.end(i64 16, i8* %tmp5) + ret void +} + +attributes #1 = { argmemonly nounwind } |

