1 ; RUN: opt -passes='print-access-info' -disable-output < %s 2>&1 | FileCheck %s
7 ; for (i = 0; i < n; i++)
8 ; *store_ptr++ = *load_ptr++ *10; // A[i] = A[i+2] * 10
10 ; make sure, we look through the PHI to conclude that store_ptr and load_ptr
11 ; both have A as their underlying object. The dependence is safe for
12 ; vectorization requiring no memchecks.
14 ; Otherwise we would try to prove independence with a memcheck that is going
17 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
18 target triple = "x86_64-apple-macosx10.10.0"
20 ; CHECK: Memory dependences are safe{{$}}
22 define void @f(i8* noalias %A, i64 %width) {
24 %A_ahead = getelementptr inbounds i8, i8* %A, i64 2
28 %i = phi i64 [ %i.1, %for.body ], [ 0, %for.body.preheader ]
29 %load_ptr = phi i8* [ %load_ptr.1, %for.body ], [ %A_ahead, %for.body.preheader ]
30 %store_ptr = phi i8* [ %store_ptr.1, %for.body ], [ %A, %for.body.preheader ]
32 %loadA = load i8, i8* %load_ptr, align 1
34 %mul = mul i8 %loadA, 10
36 store i8 %mul, i8* %store_ptr, align 1
38 %load_ptr.1 = getelementptr inbounds i8, i8* %load_ptr, i64 1
39 %store_ptr.1 = getelementptr inbounds i8, i8* %store_ptr, i64 1
40 %i.1 = add nuw i64 %i, 1
42 %exitcond = icmp eq i64 %i.1, %width
43 br i1 %exitcond, label %for.end, label %for.body