mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
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
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user