summaryrefslogtreecommitdiff
path: root/test/Transforms/SROA
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2012-10-10 18:41:19 +0000
committerDuncan Sands <baldrick@free.fr>2012-10-10 18:41:19 +0000
commitea46827d6c4519bb054b39a81eaf4836ba63ee0a (patch)
tree4fe69e5d4588d5dbe160d6eb482cf8632150287c /test/Transforms/SROA
parent1b40b84a51a20f723bb10250fd1e9bce8cf61879 (diff)
downloadllvm-ea46827d6c4519bb054b39a81eaf4836ba63ee0a.tar.gz
llvm-ea46827d6c4519bb054b39a81eaf4836ba63ee0a.tar.bz2
llvm-ea46827d6c4519bb054b39a81eaf4836ba63ee0a.tar.xz
Add the testcase from pr13254 (the old scalarreply pass handles this wrong;
the new sroa pass handles it right). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SROA')
-rw-r--r--test/Transforms/SROA/vector-promotion.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/SROA/vector-promotion.ll b/test/Transforms/SROA/vector-promotion.ll
index 80757475a5..92051c62a7 100644
--- a/test/Transforms/SROA/vector-promotion.ll
+++ b/test/Transforms/SROA/vector-promotion.ll
@@ -189,3 +189,19 @@ entry:
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
+
+define i64 @test6(<4 x i64> %x, <4 x i64> %y, i64 %n) {
+; CHECK: @test6
+; The old scalarrepl pass would wrongly drop the store to the second alloca.
+; PR13254
+ %tmp = alloca { <4 x i64>, <4 x i64> }
+ %p0 = getelementptr inbounds { <4 x i64>, <4 x i64> }* %tmp, i32 0, i32 0
+ store <4 x i64> %x, <4 x i64>* %p0
+; CHECK: store <4 x i64> %x,
+ %p1 = getelementptr inbounds { <4 x i64>, <4 x i64> }* %tmp, i32 0, i32 1
+ store <4 x i64> %y, <4 x i64>* %p1
+; CHECK: store <4 x i64> %y,
+ %addr = getelementptr inbounds { <4 x i64>, <4 x i64> }* %tmp, i32 0, i32 0, i64 %n
+ %res = load i64* %addr, align 4
+ ret i64 %res
+}