diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-06-27 05:40:02 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-06-27 05:40:02 +0000 |
commit | 9174d5c7383490d79b6a483d73cded54e32275d6 (patch) | |
tree | 5435c19cd62be16084387e6e354bd658a6757a5f /test | |
parent | 99e0b2a8df7e3a49c0e1edd250d17604fe2fb21c (diff) | |
download | external_llvm-9174d5c7383490d79b6a483d73cded54e32275d6.zip external_llvm-9174d5c7383490d79b6a483d73cded54e32275d6.tar.gz external_llvm-9174d5c7383490d79b6a483d73cded54e32275d6.tar.bz2 |
Teach one piece of scalarrepl to handle lifetime markers. When transforming an
alloca that only holds a copy of a global and we're going to replace the users
of the alloca with that global, just nuke the lifetime intrinsics. Part of
PR10121.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133905 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/ScalarRepl/memcpy-from-global.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Transforms/ScalarRepl/memcpy-from-global.ll b/test/Transforms/ScalarRepl/memcpy-from-global.ll index 5b25864..59475ad 100644 --- a/test/Transforms/ScalarRepl/memcpy-from-global.ll +++ b/test/Transforms/ScalarRepl/memcpy-from-global.ll @@ -93,4 +93,18 @@ define void @test4() { ret void } +declare void @llvm.lifetime.start(i64, i8*) +define void @test5() { + %A = alloca %T + %a = bitcast %T* %A to i8* + call void @llvm.lifetime.start(i64 -1, i8* %a) + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) + call void @baz(i8* byval %a) +; CHECK: @test5 +; CHECK-NEXT: %a = bitcast %T* @G to i8* +; CHECK-NEXT: call void @baz(i8* byval %a) + ret void +} + + declare void @baz(i8* byval) |