1 ; RUN: opt -loop-accesses -analyze < %s | FileCheck %s
2 ; RUN: opt -passes='require<scalar-evolution>,require<aa>,loop(print-access-info)' -disable-output < %s 2>&1 | FileCheck %s
4 ; Handle memchecks involving loop-invariant addresses:
7 ; for (i = 0; i < N; ++i) {
11 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
13 ; CHECK: Memory dependences are safe with run-time checks
14 ; CHECK: Run-time memory checks:
15 ; CHECK-NEXT: Check 0:
16 ; CHECK-NEXT: Comparing group ({{.*}}):
17 ; CHECK-NEXT: %arrayidxA = getelementptr inbounds i32, i32* %a, i64 %ind
18 ; CHECK-NEXT: Against group ({{.*}}):
21 define void @f(i32* %a, i32* %b) {
25 for.body: ; preds = %for.body, %entry
26 %ind = phi i64 [ 0, %entry ], [ %inc, %for.body ]
28 %arrayidxA = getelementptr inbounds i32, i32* %a, i64 %ind
30 %loadB = load i32, i32* %b, align 4
31 store i32 %loadB, i32* %arrayidxA, align 4
33 %inc = add nuw nsw i64 %ind, 1
34 %exitcond = icmp eq i64 %inc, 20
35 br i1 %exitcond, label %for.end, label %for.body
37 for.end: ; preds = %for.body