summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-04-28 17:40:03 +0000
committerHans Wennborg <hans@hanshq.net>2014-04-28 17:40:03 +0000
commite36e11682651051ec0530d4b15f4cf50a0e8ccbd (patch)
tree6ca93755800d8e288596a572eca8c94c53d5be15 /llvm/test
parent6efaf1182bb755ed8c6e346d77e1b22f584e0748 (diff)
downloadbcm5719-llvm-e36e11682651051ec0530d4b15f4cf50a0e8ccbd.tar.gz
bcm5719-llvm-e36e11682651051ec0530d4b15f4cf50a0e8ccbd.zip
InstCombine: don't drop 'inalloca' in PromoteCastOfAllocation (PR19569)
llvm-svn: 207426
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstCombine/alloca.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/alloca.ll b/llvm/test/Transforms/InstCombine/alloca.ll
index ae1cfa1ed2f..6d0c131c51e 100644
--- a/llvm/test/Transforms/InstCombine/alloca.ll
+++ b/llvm/test/Transforms/InstCombine/alloca.ll
@@ -129,3 +129,24 @@ define void @test8() {
call void (...)* @use(i32* %x)
ret void
}
+
+; PR19569
+%struct_type = type { i32, i32 }
+declare void @test9_aux(<{ %struct_type }>* inalloca)
+declare i8* @llvm.stacksave()
+declare void @llvm.stackrestore(i8*)
+
+define void @test9(%struct_type* %a) {
+; CHECK-LABEL: @test9(
+entry:
+ %inalloca.save = call i8* @llvm.stacksave()
+ %argmem = alloca inalloca <{ %struct_type }>
+; CHECK: alloca inalloca i64, align 8
+ %0 = getelementptr inbounds <{ %struct_type }>* %argmem, i32 0, i32 0
+ %1 = bitcast %struct_type* %0 to i8*
+ %2 = bitcast %struct_type* %a to i8*
+ call void @llvm.memcpy.p0i8.p0i8.i32(i8* %1, i8* %2, i32 8, i32 4, i1 false)
+ call void @test9_aux(<{ %struct_type }>* inalloca %argmem)
+ call void @llvm.stackrestore(i8* %inalloca.save)
+ ret void
+}
OpenPOWER on IntegriCloud