diff options
author | Chris Lattner <sabre@nondot.org> | 2011-02-19 19:31:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-02-19 19:31:39 +0000 |
commit | 3a393728a62122d7009d8e2cbe52a221874e576a (patch) | |
tree | 2b6b4c0e13d0dd76328dd7b31884b0643bd109ef /test/Transforms/LoopIdiom | |
parent | 9bb83e4f488e8675e309e4a875a05a088e4c011b (diff) | |
download | external_llvm-3a393728a62122d7009d8e2cbe52a221874e576a.zip external_llvm-3a393728a62122d7009d8e2cbe52a221874e576a.tar.gz external_llvm-3a393728a62122d7009d8e2cbe52a221874e576a.tar.bz2 |
Implement rdar://9009151, transforming strided loop stores of
unsplatable values into memset_pattern16 when it is available
(recent darwins). This transforms lots of strided loop stores
of ints for example, like 5 in vpr:
Formed memset: call void @memset_pattern16(i8* %4, i8* getelementptr inbounds ([16 x i8]* @.memset_pattern9, i32 0, i32 0), i64 %tmp25)
from store to: {%3,+,4}<%11> at: store i32 3, i32* %scevgep, align 4, !tbaa !4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopIdiom')
-rw-r--r-- | test/Transforms/LoopIdiom/basic.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Transforms/LoopIdiom/basic.ll b/test/Transforms/LoopIdiom/basic.ll index a94aaf1..ead2e6f 100644 --- a/test/Transforms/LoopIdiom/basic.ll +++ b/test/Transforms/LoopIdiom/basic.ll @@ -273,3 +273,30 @@ for.end13: ; preds = %for.inc10 ; CHECK-NOT: store ; CHECK: ret void } + +; On darwin10 (which is the triple in this .ll file) this loop can be turned +; into a memset_pattern call. +; rdar://9009151 +define void @test11(i32* nocapture %P) nounwind ssp { +entry: + br label %for.body + +for.body: ; preds = %entry, %for.body + %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.body ] + %arrayidx = getelementptr i32* %P, i64 %indvar + store i32 1, i32* %arrayidx, align 4 + %indvar.next = add i64 %indvar, 1 + %exitcond = icmp eq i64 %indvar.next, 10000 + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body + ret void +; CHECK: @test11 +; CHECK-NEXT: entry: +; CHECK-NEXT: bitcast +; CHECK-NEXT: memset_pattern +; CHECK-NOT: store +; CHECK: ret void +} + + |