1 ; RUN: opt -loop-accesses -analyze < %s | FileCheck %s
3 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
5 ; We shouldn't quit the analysis if we encounter a pointer without known
6 ; bounds *unless* we actually need to emit a memcheck for it. (We only
7 ; compute bounds for SCEVAddRecs so A[i*I] is deemed not having known bounds.)
9 ; for (i = 0; i < 20; ++i)
13 ; CHECK: Report: unsafe dependent memory operations in loop
14 ; CHECK-NOT: Report: cannot identify array bounds
15 ; CHECK: Interesting Dependences:
17 ; CHECK: %loadA = load i16, i16* %arrayidxA, align 2 ->
18 ; CHECK: store i16 %mul, i16* %arrayidxA, align 2
20 define void @f(i16* %a) {
24 for.body: ; preds = %for.body, %entry
25 %ind = phi i64 [ 0, %entry ], [ %add, %for.body ]
27 %access_ind = mul i64 %ind, %ind
29 %arrayidxA = getelementptr inbounds i16, i16* %a, i64 %access_ind
30 %loadA = load i16, i16* %arrayidxA, align 2
32 %mul = mul i16 %loadA, 2
34 store i16 %mul, i16* %arrayidxA, align 2
36 %add = add nuw nsw i64 %ind, 1
37 %exitcond = icmp eq i64 %add, 20
38 br i1 %exitcond, label %for.end, label %for.body
40 for.end: ; preds = %for.body