When scalar replacement returns a vector type, only accept it if the vector
[oota-llvm.git] / test / Transforms / ScalarRepl / 2011-06-17-VectorPartialMemset.ll
index 29d195eba361c0cb7915360d21e459976a92a5ea..f8530d68a8fb9ffab6a0ddb9db833dd51ada03cb 100644 (file)
@@ -19,4 +19,19 @@ entry:
   ret float %val
 }
 
+; CHECK: g
+; CHECK-NOT: alloca
+; CHECK: and i128
+
+define void @g() nounwind ssp {
+entry:
+  %a = alloca { <4 x float> }, align 16
+  %p = bitcast { <4 x float> }* %a to i8*
+  call void @llvm.memset.p0i8.i32(i8* %p, i8 0, i32 16, i32 16, i1 false)
+  %q = bitcast { <4 x float> }* %a to [2 x <2 x float>]*
+  %arrayidx = getelementptr inbounds [2 x <2 x float>]* %q, i32 0, i32 0
+  store <2 x float> undef, <2 x float>* %arrayidx, align 8
+  ret void
+}
+
 declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind