summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-06-27 05:40:02 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-06-27 05:40:02 +0000
commita61df3f843f3ec49fb6952a5a4cf94c0938307a4 (patch)
tree85edb6729992726a590f3ad8a94a75778cf1759e /llvm/test
parent3e334a42d703e0d1c482e564ca05192db6e83047 (diff)
downloadbcm5719-llvm-a61df3f843f3ec49fb6952a5a4cf94c0938307a4.tar.gz
bcm5719-llvm-a61df3f843f3ec49fb6952a5a4cf94c0938307a4.zip
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. llvm-svn: 133905
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/ScalarRepl/memcpy-from-global.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ScalarRepl/memcpy-from-global.ll b/llvm/test/Transforms/ScalarRepl/memcpy-from-global.ll
index 5b258645344..59475adc77f 100644
--- a/llvm/test/Transforms/ScalarRepl/memcpy-from-global.ll
+++ b/llvm/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)
OpenPOWER on IntegriCloud