summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-06-18 06:17:51 +0000
committerCameron Zwarich <zwarich@apple.com>2011-06-18 06:17:51 +0000
commit9601ddb2f306b6fad7aa1e34ccd3973fe7145275 (patch)
treed5049ea6eb0d258744dd55ff18a74dde99c8fea6 /llvm/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll
parent80ed9dc9e58f356139785cfb6a9f24cb64b76986 (diff)
downloadbcm5719-llvm-9601ddb2f306b6fad7aa1e34ccd3973fe7145275.tar.gz
bcm5719-llvm-9601ddb2f306b6fad7aa1e34ccd3973fe7145275.zip
When scalar replacement returns a vector type, only accept it if the vector
type's bitwidth matches the (allocated) size of the alloca. This severely pessimizes vector scalar replacement when the only vector type being used is something like <3 x float> on x86 or ARM whose allocated size matches a <4 x float>. I hope to fix some of the flawed assumptions about allocated size throughout scalar replacement and reenable this in most cases. llvm-svn: 133338
Diffstat (limited to 'llvm/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll')
-rw-r--r--llvm/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll b/llvm/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll
index 29d195eba36..f8530d68a8f 100644
--- a/llvm/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll
+++ b/llvm/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll
@@ -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
OpenPOWER on IntegriCloud