[llvm-commits] [llvm] r165644 - /llvm/trunk/test/Transforms/SROA/vector-promotion.ll

Duncan Sands baldrick at free.fr
Wed Oct 10 11:41:19 PDT 2012


Author: baldrick
Date: Wed Oct 10 13:41:19 2012
New Revision: 165644

URL: http://llvm.org/viewvc/llvm-project?rev=165644&view=rev
Log:
Add the testcase from pr13254 (the old scalarreply pass handles this wrong;
the new sroa pass handles it right).

Modified:
    llvm/trunk/test/Transforms/SROA/vector-promotion.ll

Modified: llvm/trunk/test/Transforms/SROA/vector-promotion.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SROA/vector-promotion.ll?rev=165644&r1=165643&r2=165644&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SROA/vector-promotion.ll (original)
+++ llvm/trunk/test/Transforms/SROA/vector-promotion.ll Wed Oct 10 13:41:19 2012
@@ -189,3 +189,19 @@
 
 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
+}





More information about the llvm-commits mailing list