mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
implement the "no aliasing accesses in loop" safety check. This pass
should be correct now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122659 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -42,3 +42,26 @@ for.end: ; preds = %for.body, %entry
|
||||
; CHECK: call void @llvm.memset.p0i8.i64(i8* %Base1, i8 1, i64 %tmp, i32 4, i1 false)
|
||||
; CHECK-NOT: store
|
||||
}
|
||||
|
||||
; This is a case where there is an extra may-aliased store in the loop, we can't
|
||||
; promote the memset.
|
||||
define void @test3(i32* %Base, i64 %Size, i8 *%MayAlias) nounwind ssp {
|
||||
entry:
|
||||
br label %for.body
|
||||
|
||||
for.body: ; preds = %entry, %for.body
|
||||
%i.011 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
|
||||
%add.ptr.i = getelementptr i32* %Base, i64 %i.011
|
||||
store i32 16843009, i32* %add.ptr.i, align 4
|
||||
|
||||
store i8 42, i8* %MayAlias
|
||||
%inc = add nsw i64 %i.011, 1
|
||||
%exitcond = icmp eq i64 %inc, %Size
|
||||
br i1 %exitcond, label %for.end, label %for.body
|
||||
|
||||
for.end: ; preds = %entry
|
||||
ret void
|
||||
; CHECK: @test3
|
||||
; CHECK-NOT: memset
|
||||
; CHECK: ret void
|
||||
}
|
||||
|
Reference in New Issue
Block a user