summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-10-15 10:24:40 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-10-15 10:24:40 +0000
commit94fc64c42fe27aa16dd5611eb3657ff0297801c8 (patch)
treead6b5f27e03ea0c56e668476967d4ca145abdbe7 /test/Transforms
parentbb1078ea1370fd0cc32f52b1b53f0b245ded42e7 (diff)
downloadllvm-94fc64c42fe27aa16dd5611eb3657ff0297801c8.tar.gz
llvm-94fc64c42fe27aa16dd5611eb3657ff0297801c8.tar.bz2
llvm-94fc64c42fe27aa16dd5611eb3657ff0297801c8.tar.xz
Follow-up fix to r165928: handle memset rewriting for widened integers,
and generally clean up the memset handling. It had rotted a bit as the other rewriting logic got polished more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165930 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/SROA/basictest.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/SROA/basictest.ll b/test/Transforms/SROA/basictest.ll
index 4a87d911e2..b33ffa65f6 100644
--- a/test/Transforms/SROA/basictest.ll
+++ b/test/Transforms/SROA/basictest.ll
@@ -1034,11 +1034,24 @@ entry:
%X.sroa.0.i = alloca double, align 8
%0 = bitcast double* %X.sroa.0.i to i8*
call void @llvm.lifetime.start(i64 -1, i8* %0)
+
+ ; Store to the low 32-bits...
%X.sroa.0.0.cast2.i = bitcast double* %X.sroa.0.i to i32*
store i32 0, i32* %X.sroa.0.0.cast2.i, align 8
+
+ ; Also use a memset to the middle 32-bits for fun.
+ %X.sroa.0.2.raw_idx2.i = getelementptr inbounds i8* %0, i32 2
+ call void @llvm.memset.p0i8.i64(i8* %X.sroa.0.2.raw_idx2.i, i8 0, i64 4, i32 1, i1 false)
+
+ ; Or a memset of the whole thing.
+ call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 8, i32 1, i1 false)
+
+ ; Store to the high 32-bits...
%X.sroa.0.4.raw_idx4.i = getelementptr inbounds i8* %0, i32 4
%X.sroa.0.4.cast5.i = bitcast i8* %X.sroa.0.4.raw_idx4.i to i32*
store i32 1072693248, i32* %X.sroa.0.4.cast5.i, align 4
+
+ ; Do the actual math...
%X.sroa.0.0.load1.i = load double* %X.sroa.0.i, align 8
%accum.real.i = load double* %d, align 8
%add.r.i = fadd double %accum.real.i, %X.sroa.0.0.load1.i